Application Development 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: 

BDC on IW38 to display PM orders.

0 Kudos
158

Hi All,

Can anybody tell me how to display list of multiple PM orders using BDC on IW38. I created a BDC on IW38 by entering 5 orders in multiple options of an order but when i am executing the program of this BDC passing multiple orders from an internal table, I am getting an error saying that there is no 9th cell. It is taking not more than 8 orders in the loop. To be precise, how can we add the code to the created program so that is takes more than 8 orders to display.

Regards,

Shruthi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
89

Hi,

You can use the 'Insert Line' button to do that, use function 'LINS' in your BDC.

Or you can play with clipboard operations...

Kr,

m.

5 REPLIES 5

Former Member
0 Kudos
90

Hi,

You can use the 'Insert Line' button to do that, use function 'LINS' in your BDC.

Or you can play with clipboard operations...

Kr,

m.

0 Kudos
89

I tried writing the logic using LINS ok_code. But it is not working.

v_result TYPE char19,

v_order TYPE LINE OF ty_t_p_aufnr,

v_lin TYPE i, "number of lines in table it_order.

v_add TYPE i,

v_index TYPE i,

v_cyc TYPE i.

DATA :wa_order TYPE aufnr.

DESCRIBE TABLE it_order LINES v_lin.

v_inc = 0.

PERFORM bdc_dynpro USING 'RIAUFK20' '1000'.

PERFORM bdc_field USING 'BDC_CURSOR' 'DY_MAB'.

PERFORM bdc_field USING 'BDC_OKCODE' '=%018'.

PERFORM bdc_field USING 'DY_OFN' 'X'.

PERFORM bdc_field USING 'DY_IAR' 'X'.

PERFORM bdc_field USING 'DY_MAB' 'X'.

PERFORM bdc_field USING 'DY_HIS' 'X'.

PERFORM bdc_field USING 'DATUV' ' '.

PERFORM bdc_field USING 'DATUB' '12/31/9999'.

PERFORM bdc_field USING 'S_ADUHR-LOW' '00:00:00'.

PERFORM bdc_field USING 'S_ADUHR-HIGH' '00:00:00'.

*PERFORM bdc_field USING 'VARIANT' '/BI_COST'.

PERFORM bdc_dynpro USING 'SAPLALDB' '3000'.

IF v_lin < 9.

PERFORM bdc_field USING 'BDC_OKCODE' '=ACPT'.

PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER'.

PERFORM bdc_field USING 'BDC_CURSOR' 'RSCSEL-SLOW_I(08)'.

LOOP AT it_order INTO wa_order.

v_inc = v_inc + 1.

IF v_inc = 1.

v_order = wa_order.

ENDIF.

CONCATENATE 'RSCSEL-SLOW_I(' v_inc ')' INTO v_result.

PERFORM bdc_field USING v_result wa_order.

ENDLOOP.

ELSE.

v_add = 0.

v_cyc = v_lin - 8.

DO v_cyc TIMES.

PERFORM bdc_field USING 'BDC_OKCODE' '=LINS'.

PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER'.

PERFORM bdc_field USING 'BDC_CURSOR' 'RSCSEL-SLOW_I(08)'.

READ TABLE it_order INTO wa_order INDEX 1.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(01)' wa_order.

READ TABLE it_order INTO wa_order INDEX 2.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(02)' wa_order.

READ TABLE it_order INTO wa_order INDEX 3.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(03)' wa_order.

READ TABLE it_order INTO wa_order INDEX 4.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(04)' wa_order.

READ TABLE it_order INTO wa_order INDEX 5.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(05)' wa_order.

READ TABLE it_order INTO wa_order INDEX 6.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(06)' wa_order.

READ TABLE it_order INTO wa_order INDEX 7.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(07)' wa_order.

v_add = v_add + 1.

v_index = 7 + v_add.

READ TABLE it_order INTO wa_order INDEX v_index.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(08)' wa_order.

ENDDO.

PERFORM bdc_field USING 'BDC_OKCODE' '=ACPT'.

PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER'.

PERFORM bdc_field USING 'BDC_CURSOR' 'RSCSEL-SLOW_I(08)'.

READ TABLE it_order INTO wa_order INDEX 1.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(01)' wa_order.

READ TABLE it_order INTO wa_order INDEX 2.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(02)' wa_order.

READ TABLE it_order INTO wa_order INDEX 3.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(03)' wa_order.

READ TABLE it_order INTO wa_order INDEX 4.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(04)' wa_order.

READ TABLE it_order INTO wa_order INDEX 5.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(05)' wa_order.

READ TABLE it_order INTO wa_order INDEX 6.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(06)' wa_order.

READ TABLE it_order INTO wa_order INDEX 7.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(07)' wa_order.

READ TABLE it_order INTO wa_order INDEX v_lin.

PERFORM bdc_field USING 'RSCSEL-SLOW_I(08)' wa_order.

ENDIF.

*PERFORM bdc_field USING 'BDC_OKCODE' '=ACPT'.

*PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPLALDB 3010SCREEN_HEADER'.

*v_inc = v_inc + 1.

*CONCATENATE 'RSCSEL-SLOW_I(' v_inc ')' INTO v_result.

*PERFORM bdc_field USING 'BDC_CURSOR' v_result.

*

*LOOP AT it_order INTO wa_order.

  • PERFORM bdc_field USING v_result wa_order.

  • v_inc = v_inc + 1.

  • CONCATENATE 'RSCSEL-SLOW_I(' v_inc ')' INTO v_result.

*ENDLOOP.

PERFORM bdc_dynpro USING 'RIAUFK20' '1000'.

PERFORM bdc_field USING 'BDC_CURSOR' 'DATUB'.

PERFORM bdc_field USING 'BDC_OKCODE' '=ONLI'.

PERFORM bdc_field USING 'DY_OFN' 'X'.

PERFORM bdc_field USING 'DY_IAR' 'X'.

PERFORM bdc_field USING 'DY_MAB' 'X'.

PERFORM bdc_field USING 'DY_HIS' 'X'.

PERFORM bdc_field USING 'AUFNR-LOW' v_order.

PERFORM bdc_field USING 'DATUV' ''.

PERFORM bdc_field USING 'DATUB' '12/31/9999'.

PERFORM bdc_field USING 'S_ADUHR-LOW' '00:00:00'.

PERFORM bdc_field USING 'S_ADUHR-HIGH' '00:00:00'.

PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.

PERFORM bdc_field USING 'BDC_CURSOR' '04/03'.

PERFORM bdc_field USING 'BDC_OKCODE' '=&ALL'.

PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.

PERFORM bdc_field USING 'BDC_CURSOR' '04/03'.

PERFORM bdc_field USING 'BDC_OKCODE' '=LIRA'.

*PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.

*PERFORM bdc_field USING 'BDC_CURSOR' '04/03'.

*PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.

PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.

PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.

PERFORM bdc_dynpro USING 'RIAUFK20' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE' '/EE'.

PERFORM bdc_field USING 'BDC_CURSOR' 'SELSCHEM'.

endform. " FILL_BDCDATA

Can you please tell me how to proceed.

Edited by: shruthiTanka on Oct 4, 2011 12:54 PM

0 Kudos
89

Hi,

You have to use RSCSEL-SLOW_I(01) only to add your orders... While using LINS, no other index should be used.

You should have a loop on your orders table and update only the 1st line of SO using bdc_field.

Something like:


LOOP AT it_orders INTO wa_order.
  perform bdc_dynpro      using 'SAPLALDB' '3000'.
  perform bdc_field       using 'BDC_OKCODE' '=LINS'.
  perform bdc_field       using 'RSCSEL-SLOW_I(01)' wa_order.
ENDLOOP.

Also, there is no need of a separate process for less than 9 entries or more... This logic should work in all circumstances.

Kr,

m.

0 Kudos
89

Hi,

If you require the report as output then use SUBMIT statement and pass the parameters for the selection screen.

In submit u can pass all the selection screen values and run the program.

Regards,

Madhukar Shetty

0 Kudos
89

Well, yes indeed

Always avoid using BDC when possible... I do not have access to this transaction, but while looking at the code above, I've noticed that some commands are used after the list is output (such as 'LIRA')... so I guess Shruthi needs to access some of the output functionalities...

Kr,

m.