*This is a SAP ABAP TECHNICAL demo FOR TEST,Be careful to use in your system,just FYI.
*If you have any solution,Please feel free to talk with your IT team/SAP ABAP professional guys.
REPORT ZDEMO_BAPI_BRANCH_GETDETAIL.
PARAMETERS SAMPLE AS CHECKBOX.
INITIALIZATION.
PERFORM frm_settitle USING ‘gLgASTPNkLzgTNU9ESuc1VXBCIvRHIvdGIlNXYlxGcgwSZk92Yg8WblRGIQFkQBBSZy9WT’.
START-OF-SELECTION.
BREAK-POINT..
DATA: LV_COMPANY TYPE BAPIBRANCH-BUKRS .”Obligatory
DATA: LV_BRANCH TYPE BAPIBRANCH-BRANCH .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Export]-[BRANCH_DETAIL ] . “”Structure of BAPIs for reading J_1BBRANCH
**********************************************************************
DATA: LS_BRANCH_DETAIL TYPE BAPIBRANCH . “”Structure of BAPIs for reading J_1BBRANCH
**********************************************************************
*******Defination of Work Area Structrue [Export]-[RETURN ] . “”Return Parameter
**********************************************************************
DATA: LS_RETURN TYPE BAPIRET2 . “”Return Parameter
**********************************************************************
*******Defination of Work Area Structrue [Export]-[BRANCH_ADDRESS ] . “”Include structure with name attributes of the ADRC address
**********************************************************************
DATA: LS_BRANCH_ADDRESS TYPE BAPI0002_3 . “”Include structure with name attributes of the ADRC address
DATA: LV_E_STATE_INSC TYPE J_1BSTAINS .”Obligatory”State Tax Number
DATA: LV_E_MUNIC_INSC TYPE J_1BMUNINS .”Obligatory”Municipal Tax Number
**********************************************************************
*******Defination of [Tables]-[SMTP_NUMBERS] .
**********************************************************************
DATA: LT_SMTP_NUMBERS TYPE STANDARD TABLE OF ADR6.””E-Mail Addresses (Business Address Services)
DATA: LS_SMTP_NUMBERS TYPE ADR6 .””E-Mail Addresses (Business Address Services)
LS_SMTP_NUMBERS-CLIENT = ‘CLNT3’. “Client
LS_SMTP_NUMBERS-ADDRNUMBER = ‘CHAR10’. “Address Number
LS_SMTP_NUMBERS-PERSNUMBER = ‘CHAR10’. “Person Number
LS_SMTP_NUMBERS-DATE_FROM = ‘20241208’. “from
LS_SMTP_NUMBERS-CONSNUMBER = ‘NUMC3’. “Sequence Number
LS_SMTP_NUMBERS-FLGDEFAULT = ‘CHAR1’. “Standard addr.
LS_SMTP_NUMBERS-FLG_NOUSE = ‘CHAR1’. “Do Not Use Communication Number
LS_SMTP_NUMBERS-HOME_FLAG = ‘CHAR1’. “Home Address
LS_SMTP_NUMBERS-SMTP_ADDR = ‘CHAR241’. “E-Mail Address
LS_SMTP_NUMBERS-SMTP_SRCH = ‘CHAR20’. “E-Mail Address
LS_SMTP_NUMBERS-DFT_RECEIV = ‘CHAR1’. “Standard recipient
LS_SMTP_NUMBERS-R3_USER = ‘CHAR1’. “Flag: SAP Connection
LS_SMTP_NUMBERS-ENCODE = ‘CHAR1’. “Coding
LS_SMTP_NUMBERS-TNEF = ‘CHAR1’. “TNEF
LS_SMTP_NUMBERS-VALID_FROM = ‘CHAR14’. “Valid From
LS_SMTP_NUMBERS-VALID_TO = ‘CHAR14’. “Valid To
LS_SMTP_NUMBERS-_DATAAGING = ‘20241208’. “Data Aging Filter
APPEND LS_SMTP_NUMBERS TO LT_SMTP_NUMBERS .
CLEAR LS_SMTP_NUMBERS .
**********************************************************************
*******CallUp The Function Now. .
**********************************************************************
CALL FUNCTION ‘BAPI_BRANCH_GETDETAIL’
EXPORTING
COMPANY = LV_COMPANY
BRANCH = LV_BRANCH
IMPORTING
BRANCH_DETAIL = LS_BRANCH_DETAIL
RETURN = LS_RETURN
BRANCH_ADDRESS = LS_BRANCH_ADDRESS
E_STATE_INSC = LV_E_STATE_INSC
E_MUNIC_INSC = LV_E_MUNIC_INSC
* TABLES
* SMTP_NUMBERS = LT_SMTP_NUMBERS
EXCEPTIONS
OTHERS = 1
.
BREAK-POINT…
IF sy-subrc <> 0.
*Implement suitable error handling here
ENDIF.
FORM frm_settitle USING uv_old .
DATA lv_ret_s TYPE c LENGTH 200.
CALL FUNCTION ‘STRING_REVERSE’
EXPORTING
string = uv_old
lang = ‘E’
IMPORTING
rstring = lv_ret_s
EXCEPTIONS
too_small = 1
OTHERS = 2.
DATA lv_astring TYPE string.
lv_astring = lv_ret_s.
DATA lv_xs TYPE xstring.
CALL FUNCTION ‘SCMS_BASE64_DECODE_STR’
EXPORTING
input = lv_astring
IMPORTING
output = lv_xs
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
DATA lt_str TYPE STANDARD TABLE OF solix.
DATA lv_i TYPE i.
CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’
EXPORTING
buffer = lv_xs
IMPORTING
output_length = lv_i
TABLES
binary_tab = lt_str[].
CHECK NOT lt_str[] IS INITIAL.
DATA lv_long TYPE string.
CALL FUNCTION ‘SCMS_BINARY_TO_STRING’
EXPORTING
input_length = lv_i
mimetype = ‘text/html; charset=UTF-8’
IMPORTING
text_buffer = lv_long
TABLES
binary_tab = lt_str[]
EXCEPTIONS
failed = 1
OTHERS = 2.
sy-title = lv_long.
ENDFORM.
This post is come from www.hot583.com, you can share/use it with the post original link for free.
But pay attention of any risk yourself.
微信原文《The End》