cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting or time based inbound idoc posting

former_member209575
Contributor
0 Kudos

Dear All,

We have need of posting idoc's in a specific time interval in SAP ECC system. Please help us.

requirement is We are pushing idocs to ECC , but the idoc should get process only between 3 Pm to 6 PM.

Kindly help us.

Regards

Pradeep P N

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hello pradeep,

Schedule a Background job whenever you get the IDOC in to SAP .Run the Job at specific time.

We had a similar scenario where we had to post it after 24 hours.

sample code ......

start_time = "when ever you want".

WRITE docnum TO name.

SHIFT name LEFT DELETING LEADING '0'.

CONCATENATE 'POST_IDOC_' name INTO name.

CONDENSE name.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = name

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc = 0.

  • Fill idoc number

r_docnum-low = docnum.

r_docnum-sign = 'I'.

r_docnum-option = 'EQ'.

APPEND r_docnum.

  • Fille message type

r_mestyp-low = mestyp.

r_mestyp-sign = 'I'.

r_mestyp-option = 'EQ'.

APPEND r_mestyp.

  • Manual processing of IDOCS

SUBMIT rbdmani2 WITH so_docnu IN r_docnum

WITH so_mesty IN r_mestyp

WITH p_output = ''

WITH p_wodial = 'X'

VIA JOB name NUMBER number

AND RETURN.

IF sy-subrc = 0.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = number

jobname = name

sdlstrtdt = start_date

sdlstrttm = start_time

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc <> 0.

ENDIF.

ENDIF.

ENDIF.

ENDFORM. " POST_IDOC_DAYS_LATER

Thanks,

Pradeep.