Skip to Content

Failed to distribute inbound delivery to EWM in Background task

Hi All,

All settings are correct because transaction VL06i is working properly.

We developed a custom program where we do some processing to the inbound deliveries and then we have to distribute them to EWM.

I debugged VL06i and I see that standard SAP is using function module /SCWM/INB_DLV_SAVEREPLICA. So I took that FM to use it in our custom program like below image (Same way as VL06i). I'm also passing to the FM the same data as VL06i.

I'm calling BAPI_TRANSACTION_COMMIT after the FM to execute it.

The problem is that INB delivery is not getting distributed to EWM. If I check the queue (SMQ1 and SMQ2) on ERP side, I cannot find it. Then if I check table ARFCSSTATE for my execution, I see the entry is with status SYSFAIL with the following message: EWM delivery for (delnum) from (DEVSYS) was found.

Then If I check transaction /SCWM/PRDI I find the delivery but with in an error state. Distribution status of the delivery is still D(planned for distribution) on ERP side.

Any clues on what might the problem be?

Thanks in advance!

Regards!!

Emanuel.

image1.jpg (12.4 kB)
image2.jpg (73.0 kB)
image3.jpg (47.3 kB)
image3.jpg (76.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 28, 2017 at 05:47 AM

    Hi Emanuel,

    Can you please try below alternative instead of BAPI ?

    Schedule the VL06I Program via background job via selection screen delivery no.

    Hope It will work for you.

    Please let me know if you have further queries.

    Kind Regards,

    Ajit

    Just demo code below

    FM "JOB_OPEN"
    EXPORTING
    jobname = jobname IMPORTING
    jobcount = jobcount
    EXCEPTIONS
    cant_create_job = 1
    invalid_job_data = 2
    jobname_missing = 3
    OTHERS = 4.
    SUBMIT WS_MONITOR_INB_DEL_DIST VIA  JOBNAME ( PASS SELECTION SCREEN DELIVERY NO )
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    jobcount = jobcount
    jobname = jobname
    strtimmed = 'X' " IMMEDIATE
    EXCEPTIONS
    invalid_startdate = 1
    jobname_missing = 2
    job_close_failed = 3
    job_nosteps = 4
    job_notex = 5
    lock_failed = 6
    OTHERS = 7.
    
    Add comment
    10|10000 characters needed characters exceeded