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

MPP issue

ramkumar007
Participant
0 Likes
592

Hi friends ,

  

    I had a message for no item . but i entre the data based on me21 only .pls help me .....

WHEN 'CREATE'.
 
data: del_date type sy-datum ,
        pohead 
type BAPIEKKOC,
        PO_HEADER_ADD_DATA
type BAPIEKKOa,
        exp_head
type bapimepoheader,
        IT_return 
type table of bapiret2 with header line,
        WA_return 
type  bapiret2 ,
        poitem 
type table of BAPIEKPOC with header line,
        poitemx
type table of bapimepoitemx with header line,
        PO_ITEM_SCHEDULES
type table of BAPIEKET with header line,
        poschedx
type table of bapimeposchedulx with header line,
        ex_po_number
type bapimepoheader-po_number,
        po_order
TYPE BAPIEKKOC-PO_NUMBER.
     pohead
-doc_date    = wa_ekko-aedat.
     pohead
-doc_type    = wa_ekko-bsart     .
     pohead
-co_code     = wa_ekko-bukrs.
     pohead
-purch_org   = wa_ekko-ekorg.
     pohead
-pur_group   = wa_ekko-ekgrp.
     pohead
-vendor      = wa_ekko-lifnr.
  PO_HEADER_ADD_DATA
-pmnttrms    = wa_ekko-zterm.
  PO_HEADER_ADD_DATA
-incoterms1  = wa_ekko-inco1.
  PO_HEADER_ADD_DATA
-currency    = wa_ekko-waers.

LOOP AT IT_EKPO INTO WA_EKPO.
  poitem
-po_item   1.
  poitem
-material  = wa_ekpo-matnr.
  poitem
-plant     = wa_ekpo-werks.
  poitem
-STORE_LOC = wa_ekpo-lgort.
  POiTEM
-DISP_QUAN = WA_EKPO-MENGE.
  poitem
-net_price = wa_ekpo-netpr.
 
append poitem.
  PO_ITEM_SCHEDULES
-po_item  = 1.*  PO_ITEM_SCHEDULES-SERIAL_NO = TC-CURRENT_LINE.
 
append PO_ITEM_SCHEDULES.CALL FUNCTION 'BAPI_PO_CREATE'
 
EXPORTING
    po_header                       
= pohead
    PO_HEADER_ADD_DATA              
= PO_HEADER_ADD_DATA
 
tables
    po_items                        
= poitem
    po_item_schedules               
= PO_ITEM_SCHEDULES
   
RETURN                           = it_return.

    
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDLOOP.IF  SY-SUBRC = 0.
LOOP AT it_return INTO wa_return.
        
write : wa_return-MESSAGE .
       
ENDLOOP.
       
MESSAGE : wa_return-MESSAGE TYPE 'I'.
       
MESSAGE :'DATA SAVE SUCCESSFULLY' TYPE 'S'.
ENDIF.

Thanks And Regards

Ram

4 REPLIES 4
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
551

Can you please post the message number and complete message gdetails

Read only

0 Likes
551

06026   Please enter material number or account assignment category

06010   Document contains no items

Read only

0 Likes
551

06026   Please enter material number or account assignment category

06010   Document contains no items

Read only

0 Likes
551

Hi,

I think you need to pass Delivery date  the more parameters on BAPIEKET.  Is it possible to create the PO directly with ME21n?

Thanks,

Kiran