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

Problem with BAPI "BAPI_GOODSMVT_CREATE"

Former Member
0 Likes
1,259

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,183

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,183

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

Read only

0 Likes
1,183

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

Read only

0 Likes
1,183

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

Read only

0 Likes
1,183

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

Read only

0 Likes
1,183

hi,

Check whether schedule line is 0001 or 0010.

Cheers,

Sasi

Read only

0 Likes
1,183

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

Read only

0 Likes
1,183

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

Read only

Former Member
0 Likes
1,184

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

Read only

Former Member
0 Likes
1,183

Hi ,

SCHED_LINE - > Delivery schedule for sales order.

I guess you should not use it while calling BAPI.

Cheers.