Professional Documents
Culture Documents
BDC Recording To Change Vendor Name in SAP
BDC Recording To Change Vendor Name in SAP
Create Recording
- Open tcode SHDB
to...
- Click Save
- Change Postal Code and click Save
- Click Back
- Click Yes
- Select recording that was created before and click Program
- Create simple program to change Vendor Title using some part of syntax in program
YTEST_BDC_DATA.
Note : BDC main purpose is to get information about program name, screen number and field name that
was used in a tcode. No need to create program YTEST_BCD_DATA. If we already have another Z
program that use BDC syntax inside, copy that program, and get program name, screen number & field
name, from the list below (tcode SHDB) :
Create Program
- Create program YTEST_CHANGE_VENDOR_POSTALCODE to change Vendor Title
- Create selection screen input to fill Vendor Code ( vendor that we want to change its title)
and selection screen input to fill Postal Code
PARAMETERS : p_vendor TYPE lfa1-lifnr, "Vendor Code
p_pstl TYPE lfa1-pstlz. "Postal Code
- Create selection screen input to fill parameter for DBC (input mode and display mode)
PARAMETERS : ctumode LIKE ctu_params-dismode DEFAULT 'N', "BDC Display Mode
cupdate LIKE ctu_params-updmode DEFAULT 'S'. "BDC Update Mode
First Screen
PERFORM bdc_dynpro USING 'SAPMF02K' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RF02K-LIFNR' p_vendor.
PERFORM bdc_field USING 'RF02K-D0110 'X'.
Second Screen
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_OKCODE' '=UPDA'.
PERFORM bdc_field USING 'LFA1-PSTLZ' pstlcode.
Note :
First Screen
PERFORM bdc_dynpro USING 'SAPMF02K' '0106'.
==> means Program 'SAPMF02K' screen '0106' in tcode FK02
PERFORM bdc_field USING 'RF02K-D0110 'X'.
==> means we choose one option in Program 'SAPMF02K' screen '0106'
- Call transaction that we want to process with the parameter in internal table bdcdata
REFRESH messtab.
CALL TRANSACTION 'FK02' USING bdcdata
MODE ctumode
UPDATE cupdate
MESSAGES INTO messtab.
LOOP AT messtab.
MESSAGE ID messtab-msgid
TYPE messtab-msgtyp
NUMBER messtab-msgnr
INTO l_mstring
WITH messtab-msgv1
messtab-msgv2
messtab-msgv3
messtab-msgv4.
WRITE: / messtab-msgtyp, l_mstring(250).
ENDLOOP.
Note :
- bdcdata : internal table whic the datc collected from routine bdc_dynpro and bdc_field
- Result
- Result
press enter
press enter