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

Price change BDC using MR21

Former Member
0 Likes
2,441

Hello,

We want to update price of material using t-code MR21. We have around 18000 material.

We have created a BDC for this. The problem is that MR21 takes some entries in first screen and then we have to page down to pass furthur entries. We are facing problem in passing entries after page down. Also we have noticed that when we run MR21 in one machine it takes 20 entries in first screen, if run in the second screen it takes 13 entries.

Please suggest how to pass entries using page down in MR21.

Thanx

RR

Hello,

We want to update price of material using t-code MR21. We have around 18000 material.

We have created a BDC for this. The problem is that MR21 takes some entries in first screen and then we have to page down to pass furthur entries. We are facing problem in passing entries after page down. Also we have noticed that when we run MR21 in one machine it takes 20 entries in first screen, if run in the second screen it takes 13 entries.

Please suggest how to pass entries using page down in MR21.

Thanx

RR

4 REPLIES 4
Read only

Former Member
0 Likes
1,439

Hi Rajiv ,

First I will suggest you to go for LSMW instead of BDC . It will solve most of such problems for you.

Secondly in BDC you will specifically have to write a logic to handle this situation.

As mentioned below , as its taking different number of entries : is it fix that it always takes 2o entries in first screen and 13 in second. Thne you can handle this in BDC code. but if that is different in dufferent runs then you can do as below

Do as below

Do a BDC Recording where you will all the time click on the next page icon while making entry for every item. Hope you get this. It will solve your problem.

Regards,

Uma

Read only

Former Member
0 Likes
1,439

Hi Rajiv ,

try the bapi

BAPI_MATVAL_PRICE_CHANGE

BAPI_M_REVAL_CREATEPRICECHANGE

Read only

Former Member
0 Likes
1,439

Hi,

Records the BDC recording with the DEFAULT SIZE checkbox tick while recording this will solve the problem of the no of entries difference on different m/c.

Edited by: Madhukar Shetty on Jun 9, 2010 7:57 AM

Read only

Former Member
0 Likes
1,439

Hi Rajiv,

Yes, there is index problem in MR21 BDC, I faced the same one.

Giving you my code from MR21 BDC, I am sure this will help you to solve the issue.

If other help required, kindly reply -


CLEAR w_index.

  DESCRIBE TABLE it_exceldata LINES data_lines.

  LOOP AT it_exceldata .

    w_index = w_index + 1.             "****************

    PERFORM bdc_dynpro USING 'SAPRCKM_MR21' '0201'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'.

    PERFORM bdc_tfield  USING 'CKI_MR21_0250-MATNR'       it_exceldata-matnr       w_index.
    PERFORM bdc_tfield  USING 'CKI_MR21_0250-NEWVALPR'    it_exceldata-newvalpr    w_index.

    nxtpage = w_index MOD 11.      "********************

    IF nxtpage = 0.
      CLEAR w_index.
      PERFORM bdc_dynpro      USING 'SAPRCKM_MR21' '0201'.
      PERFORM bdc_field USING 'BDC_OKCODE' '=DOWN'.
    ENDIF.

  ENDLOOP.

  PERFORM bdc_dynpro USING 'SAPRCKM_MR21' '0201'.
  PERFORM bdc_field USING 'BDC_OKCODE' '=SAVE'.

  CALL TRANSACTION 'MR21' USING bdcdata
                          MODE  v_mode
                          UPDATE 'A'
                          MESSAGES INTO itab_bdc.

Regards,

Ashlesha