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

call transaction using bdcdata_tab

Former Member
0 Likes
1,376

I am using call transaction using bdcdata_tab to input the Tracking Number under Item Overview in Create Purchase Order ME21N. The code I have always displays the error msg 'Field MEPO1211-BEDNR does not exist in screen SAPLMEGUI 0014'. Can any one tell me what I am doing wrong. Thank you.

DATA: bdcdata_wa  TYPE bdcdata,
      bdcdata_tab TYPE TABLE OF bdcdata.

CLEAR bdcdata_wa.
bdcdata_wa-program  = 'SAPLMEGUI'.
bdcdata_wa-dynpro   = '14'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'MEPO1211-BEDNR'.
bdcdata_wa-fval = 'TEST'.
APPEND bdcdata_wa TO bdcdata_tab.

CALL TRANSACTION 'ME21N' using bdcdata_tab.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
995

Hi Megan, not sure if this is related to your error, but definitly ME21N may not work correctly in BDC. The reason is that it is an enjoy transaction which uses frontend controls, which are highly dependent on SAPgui, in BDC, there may be a disconnect with the SAPgui. So really, it is suggested to use the non-enjoy transaction when doing BDC, for example, in your case, you should do your recording over ME21 instead of ME21N.

Regards,

RIch Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
996

Hi Megan, not sure if this is related to your error, but definitly ME21N may not work correctly in BDC. The reason is that it is an enjoy transaction which uses frontend controls, which are highly dependent on SAPgui, in BDC, there may be a disconnect with the SAPgui. So really, it is suggested to use the non-enjoy transaction when doing BDC, for example, in your case, you should do your recording over ME21 instead of ME21N.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
995

How would I implement this using ME21?

I need to first pass the Vendor, Purch Org & Purch Group.

and then pass Tracking Number, Requisitioner & Dlv Date as current date

Should I do

CALL TRANSACTION ME21 USING BDCDATA_TAB AND SKIP FIRST SCREEN

Read only

Former Member
0 Likes
995

I tried this to Create Purchase Order and default the Short Text under PO Items. It gives me error ''EKPO-TXZ01 field not found in Screen' which is the same error that I got using ME21N as well.

Also it does not skip first screen

CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPMM06E'.
bdcdata_wa-dynpro = '100'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.

clear bdcdata_wa.
bdcdata_wa-fnam = 'EKKO-LIFNR'.
bdcdata_wa-fval = '109460'.
APPEND bdcdata_wa TO bdcdata_tab.

clear bdcdata_wa.
bdcdata_wa-fnam = 'EKKO-EKORG'.
bdcdata_wa-fval = 'E101'.
APPEND bdcdata_wa TO bdcdata_tab.

clear bdcdata_wa.
bdcdata_wa-fnam = 'EKKO-EKGRP'.
bdcdata_wa-fval = '403'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPMM06E'.
bdcdata_wa-dynpro = '120'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.

clear bdcdata_wa.
bdcdata_wa-fnam = 'EKPO-TXZ01'.
bdcdata_wa-fval = 'Test'.
APPEND bdcdata_wa TO bdcdata_tab.

CALL TRANSACTION 'ME21' USING bdcdata_tab AND SKIP FIRST SCREEN .

Message was edited by:

Megan Flores

Read only

0 Likes
995

Hi,

Screen 120 is table control you need to use like this way


    v_slno = '01'.
    concatenate 'EKPO-TXZ01(' v_slno ')' into  v_text_1.
    condense  v_text_1.

 then 

    bdcdata_wa-fnam = v_text_1.

Here v_slno should be arrived according to line item number

a®

Read only

0 Likes
995

Hi Megan,

I want a clarification on BDC_DATA.

Can you please tell what does bdcdata_wa-dynbegin indicates in your program?

--

Regards

Vinay Bedre

Read only

krzysztof_konitz4
Contributor
0 Likes
995

Hi,

Try to use BAPIs: BAPI_PO_CREATE, BAPI_PO_CHANGE...

Krzys