Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bdc for mr21

Former Member
0 Likes
486

hi to all experts,

I need a sample bdc code for uploading price change using mr21 tcode

1 REPLY 1
Read only

Former Member
0 Likes
372

best thing would be do the recording using SHDB Transaction and capture all screen fields.

Anyhow see the sample code :

report ZTESTMR21

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPRCKM_MR21' '0201'.

perform bdc_field using 'BDC_CURSOR'

'MR21HEAD-BUKRS'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MR21HEAD-BUDAT'

'08/21/2007'.

perform bdc_field using 'MR21HEAD-BUKRS'

'0011'.

perform bdc_field using 'MR21HEAD-WERKS'

'1000'.

perform bdc_field using 'MR21HEAD-SCREEN_VARIANT'

'MR21_LAGERMATERIAL_0250'.

perform bdc_dynpro using 'SAPRCKM_MR21' '0201'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'BDC_CURSOR'

'CKI_MR21_0250-NEWPEINH(01)'.

perform bdc_field using 'MR21HEAD-SCREEN_VARIANT'

'MR21_LAGERMATERIAL_BWKEY_0250'.

perform bdc_field using 'CKI_MR21_0250-MATNR(01)'

'300300300'.

perform bdc_field using 'CKI_MR21_0250-NEWVALPR(01)'

'1'.

perform bdc_field using 'CKI_MR21_0250-NEWPEINH(01)'

'1'.

perform bdc_dynpro using 'SAPRCKM_MR21' '0201'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_field using 'BDC_CURSOR'

'CKI_MR21_0250-MATNR(02)'.

perform bdc_field using 'MR21HEAD-SCREEN_VARIANT'

'MR21_LAGERMATERIAL_BWKEY_0250'.

perform bdc_transaction using 'MR21'.

perform close_group.

Thanks

Seshu