0% found this document useful (0 votes)
120 views2 pages

BDC Production Version

The document contains ABAP code to create a production version for material master data. It loops through plant data, calls transaction codes to navigate screens and enter data, and commits the changes. Key steps include: 1) Converting a date to external format for input 2) Looping through plant data and navigating to appropriate transaction screens 3) Entering material, plant, version, and validity period data 4) Committing the changes to create the production version for each plant

Uploaded by

Aarif Raza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views2 pages

BDC Production Version

The document contains ABAP code to create a production version for material master data. It loops through plant data, calls transaction codes to navigate screens and enter data, and commits the changes. Key steps include: 1) Converting a date to external format for input 2) Looping through plant data and navigating to appropriate transaction screens 3) Entering material, plant, version, and validity period data 4) Committing the changes to create the production version for each plant

Uploaded by

Aarif Raza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

DATA : lv_datum TYPE char10.

CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'


EXPORTING
date_internal = sy-datum
IMPORTING
date_external = lv_datum
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

LOOP AT lt_plantdata ASSIGNING FIELD-SYMBOL(<lfs_plantdata>).


REFRESH gt_bdcdata.

PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.


PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-MATNR'
<lfs_plantdata>-material_long.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(14)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(14)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-WERKS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'RMMG1-WERKS'
<lfs_plantdata>-plant.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PB03'.
PERFORM bdc_dynpro USING 'SAPLMDIA' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MKAL-BDATU(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=DETA'.
PERFORM bdc_field USING 'MKAL-VERID(01)'
'0001'.
PERFORM bdc_field USING 'MKAL-TEXT1(01)'
'Production Version'.
PERFORM bdc_field USING 'MKAL-ADATU(01)'
lv_datum.
PERFORM bdc_field USING 'MKAL-BDATU(01)'
'31.12.2099'.
PERFORM bdc_dynpro USING 'SAPLMDIA' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MKAL-STLAN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MKAL-TEXT1'
'Production Version'.
PERFORM bdc_field USING 'MKAL-ADATU'
lv_datum.
PERFORM bdc_field USING 'MKAL-BDATU'
'31.12.2099'.
PERFORM bdc_field USING 'MKAL-STLAL'
'1'.
PERFORM bdc_field USING 'MKAL-STLAN'
'3'.
PERFORM bdc_dynpro USING 'SAPLMDIA' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MKAL-BDATU(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.

f_option-updmode = 'S'.
f_option-defsize = abap_true.
f_option-dismode = 'N'.
f_option-cattmode = space.
f_option-racommit = space.
f_option-nobinpt = abap_true.
f_option-nobiend = abap_true.
CALL TRANSACTION 'MM02' USING gt_bdcdata
OPTIONS FROM f_option MESSAGES INTO gt_messag
es.

ENDLOOP.

You might also like