IF lv_use_call = 'X'.
* Use the CALL TRANSACTION method
PERFORM bdc_dynpro USING 'SAPLSFUNCTION_BUILDER' '1008'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RS38L-NAME'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WB_EXEC'.
PERFORM bdc_field USING 'RS38L-NAME' lv_fmname.
CALL TRANSACTION 'SE37' USING i_bdc_data MODE 'E'.
ELSE.
* Use the BDC_TRANSACTION method
PERFORM bdc_open_group.
PERFORM bdc_dynpro USING 'SAPLSFUNCTION_BUILDER' '1008'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RS38L-NAME'.
PERFORM bdc_field USING 'BDC_OKCODE' '=WB_EXEC'.
PERFORM bdc_field USING 'RS38L-NAME' lv_fmname.
PERFORM bdc_transaction USING 'SE37'.
PERFORM bdc_close_group.
ENDIF.
*----------------------------------------------------------------------*
* FORM bdc_open_group
*----------------------------------------------------------------------*
* [+] Opens a group for a BDC session
*----------------------------------------------------------------------*
FORM bdc_open_group.
DATA:
lv_group(12) TYPE c VALUE 'MY_GROUP'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = lv_group
user = sy-uname
keep = ' '
holddate = sy-datum.
ENDFORM. "bdc_open_group
*----------------------------------------------------------------------*
* FORM bdc_close_group
*----------------------------------------------------------------------*
* [+] Closes a BDC group
*----------------------------------------------------------------------*
FORM bdc_close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. "bdc_close_group
*----------------------------------------------------------------------*
* FORM bdc_transaction
*----------------------------------------------------------------------*
* [+] Call a transaction in a BDC session
*----------------------------------------------------------------------*
FORM bdc_transaction USING tcode.
*----------------------------------------------------------------------*
* FORM bdc_dynpro
*----------------------------------------------------------------------*
* [+] Add a screen to a BDC session
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR v_bdc_data.
*----------------------------------------------------------------------*
* FORM bdc_field
*----------------------------------------------------------------------*
* [+] Adds a value to a field on a screen, for a BDC session
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
CLEAR v_bdc_data.
v_bdc_data-fnam = fnam.
v_bdc_data-fval = fval.
APPEND v_bdc_data TO i_bdc_data.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.