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: 

no material document created with BAPI_GOODSMVT_CREATE

eric_colas
Explorer
0 Kudos
1,025

Hi all,

I try to perform an IM transfer with 323 movement from BAPI_GOODSMVT_CREATE.

It works with IM to IM storage location.

It doesn't work when IM target storage location is connected to WM warehouse number and schould create an inbound delivery :

the return code from the bapi is 0, there is no message in return table and no document number generated.

(same data in MB1B works witout any problem)

can you help me please ?

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos
383

Have you look at OSS notes?

https://websmp103.sap-ag.de/notes

Thanks

SK

5 REPLIES 5

former_member181966
Active Contributor
0 Kudos
384

Have you look at OSS notes?

https://websmp103.sap-ag.de/notes

Thanks

SK

Former Member
0 Kudos
383

Hi !

I have done so a lot of times - with no problems....

Could yoe please post the code in with the parameters are set and the BAPI is called ?

Regards

Rainer

eric_colas
Explorer
0 Kudos
383

thanks for your answers !

I already try to find an OSS note (213 notes about this BAPI)...

the call to the bapi is not performed directly, i use an intermediate storage in a table "ZGOODSMVT" which i use for other movements without any problem (same fields than BAPI parameters).

(the 323 works when IM destination storage location is not connected to WM warehouse number).

here is the code from first prog :



form mvt_323.
clear zgoodsmvt.
zgoodsmvt-ref_doc_yr = mkpf-budat(4).
zgoodsmvt-ref_doc = mkpf-mblnr.
zgoodsmvt-ref_doc_it = mseg-zeile.
zgoodsmvt-nseq = 0.
zgoodsmvt-pstng_date = mkpf-budat.
zgoodsmvt-doc_date = mkpf-budat.
zgoodsmvt-ref_doc_no = mkpf-mblnr.
zgoodsmvt-header_txt = 'Transfert automatique'.
zgoodsmvt-gm_code = '04'. " Transfert
zgoodsmvt-material = mseg-matnr.
zgoodsmvt-plant = mseg-werks.
zgoodsmvt-stge_loc = mseg-lgort.
zgoodsmvt-batch = mseg-charg.
zgoodsmvt-move_type = '323'.
zgoodsmvt-entry_qnt = mseg-erfmg.
zgoodsmvt-entry_uom = mseg-erfme.
zgoodsmvt-item_text = 'Transfert automatique'.
zgoodsmvt-move_plant = mseg-werks.
zgoodsmvt-move_stloc = 'BVSG'.
zgoodsmvt-batch = mseg-charg.
zgoodsmvt-udate = sy-datum.
zgoodsmvt-uname = sy-uname.
zgoodsmvt-utime = sy-uzeit.
INSERT zgoodsmvt.

IF sy-subrc ne 0.
retco = sy-subrc.
EXIT.
ENDIF.
endform.


here is the code from second prog :

SELECT * FROM zgoodsmvt APPENDING CORRESPONDING FIELDS OF TABLE t

WHERE type NE 'S'.

*----

-


*

*

LOOP AT t.

CLEAR : ti, tr, ir.

REFRESH: ti, tr.

FREE : ti, tr.

MOVE-CORRESPONDING: t TO w_goodsmvt_header, t TO w_goodsmvt_code.

*

MOVE-CORRESPONDING: t TO ti, t TO ir.

APPEND ti. " item

*

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = w_goodsmvt_header

goodsmvt_code = w_goodsmvt_code

testrun = ptestrun

IMPORTING

  • GOODSMVT_HEADRET =

materialdocument = w_materialdocument

matdocumentyear = w_matdocumentyear

TABLES

goodsmvt_item = ti

  • GOODSMVT_SERIALNUMBER =

return = tr.

*

IF sy-subrc NE 0. " tjr à 0, les erreurs sont ds TR

WRITE:/ text-250, sy-subrc.

ENDIF.

*

Thank you for your help,

regards

Eric

0 Kudos
383

Hi !

Try

zgoodsmvt-gm_code = '06'

(change 04 to 06)

Be sure that ptestrun is initial.

Try a COMMIT WORK after the

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'.

The Bapi starts working if the application does a COMMIT.

Do you get back any value in w_materialdocument ?

Regards

Rainer

0 Kudos
383

Hi !

06 doesn't work (not for transfer mvt)

ptestrun is initial and commit is ok (It works with IM to IM storage location)

i have no value in w_materialdocument...

thanks for your help Rainer !

Eric