‎2005 Sep 08 11:29 AM
Hi,
This is my Code below:
*********************************************
REPORT ZFG_UPLOAD.
DATA: gmove_header LIKE bapi2017_gm_head_01,
gmove_code LIKE bapi2017_gm_code.
DATA: BEGIN OF gmove_line OCCURS 0.
INCLUDE STRUCTURE bapi2017_gm_item_create.
DATA: END OF gmove_line.
DATA: headret LIKE bapi2017_gm_head_ret,
matdoc TYPE bapi2017_gm_head_ret-mat_doc,
docyear TYPE bapi2017_gm_head_ret-doc_year.
DATA: BEGIN OF return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF return.
gmove_header-pstng_date = sy-datum.
gmove_header-doc_date = sy-datum.
gmove_header-pr_uname = sy-uname.
***gmove_header-header_txt = 'Testing'.
***gmove_header-ref_doc_no = '4500000268'.
gmove_code-gm_code = '01'.
gmove_line-move_type = '101'.
gmove_line-plant = '1000'.
gmove_line-mvt_ind = 'B'.
gmove_line-po_number = '4500000268'.
gmove_line-po_item = 1.
gmove_line-entry_qnt = 6.
gmove_line-entry_uom = 'M'.
gmove_line-batch = 'KK1'.
gmove_line-stge_loc = '40'.
***gmove_line-MATERIAL = '000000J6000102GREY'.
APPEND gmove_line.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = gmove_header
GOODSMVT_CODE = gmove_code
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET = headret
MATERIALDOCUMENT = matdoc
MATDOCUMENTYEAR = docyear
TABLES
GOODSMVT_ITEM = gmove_line
GOODSMVT_SERIALNUMBER =
RETURN = return.
AFS_GOODSMVT_SKU =
COMMIT WORK AND WAIT.
*************************************************
When I check the "return" it say's "No goods receipt possible for purchase order 4500000268 00001".
I am using - AFS 5.0
The Material in PO is AFS item.
Could someone help me, please!!!
Thanks,
Kishan
‎2005 Sep 08 11:45 AM
Hi,
Your code seems to be fine.
Check is it possible via MIGO transaction for 4500000268 00001.
is there any prbs with this PO and Item no.
Cheers,
Sasi
‎2005 Sep 08 11:44 AM
Hi Kishan,
Check your item number, typically item numbers are 10,20,30 ... etc. not 1,2,3. Although it is possible to have item numbers as 1,2,3 etc but generally that is not the case.
Cheers,
Sanjeev
‎2005 Sep 08 12:07 PM
Hi All,
Your Points Awarded!!!
Thanks I corrected the PO Item;
gmove_line-po_item = 10.
But now the following error is returned;
"Entry 4500000268 00010 0000 not valid; correct entry"
Thanks,
Kishan
‎2005 Sep 08 12:29 PM
I don't know why it is saying that but I can tell you that it is thinking that the schedule line (EKET-ETENR) is 0000 (last four digits). As suggested by Sasi, you should first check whether your data is correct or not using Txn MIGO.
Cheers,
Sanjeev
‎2005 Sep 08 1:23 PM
Hi Sanjeev
Thanks for the help. I put "gmove_line-SCHED_LINE = 1" this I got from the EKET-ETENR against the PO I am using.
But still this error follows. In MIGO I tested the PO it work perfectly. The error that comes from BAPI is "Entry 4500000268 00010 0000 not valid; correct entry".
Thanks,
Kishan
‎2005 Sep 08 1:36 PM
‎2005 Sep 08 1:42 PM
Hi,
In Migo note that what are the values you entered, the same kind of input you pass to this function module, it should work.
Cheers,
Sasi
‎2005 Sep 08 7:25 PM
logically thinking, you don't need to specify schedule line for posting "101" . Even when you post "101" in MIGO you don't specify that. I think you should try to debug the BAPI to see what is causing this.
Cheers,
Sanjeev
‎2005 Sep 08 11:45 AM
Hi,
Your code seems to be fine.
Check is it possible via MIGO transaction for 4500000268 00001.
is there any prbs with this PO and Item no.
Cheers,
Sasi
‎2005 Sep 08 8:13 PM
Hi ,
SCHED_LINE - > Delivery schedule for sales order.
I guess you should not use it while calling BAPI.
Cheers.