04-23-2008 8:21 AM
Dear Experts,
I am writing BDC for MR21 t-code.
I try with single material code prog is working perfectly.
Now I have 5 material code with new price.
But prog is taking one-by-one record and asking for save.
Instead of this i want 5 material in single doc.
what change i should make in my BDC. Because this is testing , actually in single doc more than 300 material will come.
Please advice me.
Thanks. Raj.
04-23-2008 8:31 AM
Hi,
Try this BAPI
BAPI_M_REVAL_CREATEPRICECHANGE
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.
Regards
Kiran Sure
04-23-2008 9:06 AM
Thanks kiran,
but your prog also work for 2 material but what about multiple material code.