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

program when background

Former Member
0 Likes
257

Hi

i have changed the existing program variant for new customer.

its running well when foreground. wheni run it in back ground its still taking the values of old customer to which i used for this program.

my program logic as below.

IF sy-batch = isbackground.

REFRESH : mblnr, mjahr, budat, matnr, charg.

  • Get the Last read of Material Document Number from Interface Table

CONCATENATE 'AUTOSO_' w_customercd INTO id.

SELECT SINGLE * FROM zx01_map WHERE id = id.

IF sy-subrc = 0 AND NOT zx01_map-key1 IS INITIAL.

CLEAR: mblnr, mjahr.

mblnr+0(3) = 'IGT'. mblnr-high = mblnr-low = zx01_map-key1.

mblnr-high+2(8) = '99999999'.

APPEND mblnr.

mjahr+0(3) = 'IEQ'. mjahr-low = zx01_map-key2. APPEND mjahr.

mjahr0(3) = 'IEQ'. mjahr-low = sy-datum0(4). COLLECT mjahr.

ENDIF.

ENDIF.

and it will update my table with key field

IF sy-batch = isbackground.

  • Update the last run for Material Document Number

CLEAR itab.

SORT itab DESCENDING BY mblnr mjahr.

READ TABLE itab INDEX 1.

IF sy-subrc IS INITIAL.

CONCATENATE 'AUTOSO_' w_customercd INTO id.

UPDATE zx01_map

SET key1 = itab-mblnr key2 = itab-mjahr key3 = mblnr-low

key4 = mjahr-low WHERE id = id.

ENDIF.

ENDIF.

1 REPLY 1
Read only

Former Member
0 Likes
237

Please try to do after putting break-point in it. It seems something is missing.

Regards

Shashi