on 02-22-2005 5:02 AM
Could you pls see below code.(junk char are japanese char so pls dont mind it.)
when i execute this program, i get 5times the same output in spool output sp01.i dont know why..its looping like this.i guess Call transaction execution at background is still executing..its in background mode eventhough i execute this program in foreground.(now i commented this Call transaction modue, u can see below)
Whenever i refresh spool or sm37 i get always jobs generated in the list.couldyou pls tell me how to delete such background job executing.
i saw in sm50, i found 4BTC in Ready state.should i have to delete these sessions.
REPORT ZGLT0_REPORT_V1 no standard page heading message-id zx.
include zbdcrecxx_v2.
Tables: GLT0,
sscrfields,
SKB1.
FIELD-SYMBOLS: .
DATA: SUM(16) type C,
SUMVAL LIKE GLT0-HSL01,
CNT TYPE I,
FZ(10) TYPE C,
W_NEWBS1(2) TYPE C,
W_NEWBS2(2) TYPE C.
DATA:
BEGIN OF gltz occurs 0,
RACCT LIKE GLT0-RACCT, "¨èR[h
hslvt LIKE glt0-hslvt, " ÊÝJzc
hsl01 LIKE glt0-hsl01, " ÊÝúÔv
hsl02 LIKE glt0-hsl02, " ÊÝúÔv
hsl03 LIKE glt0-hsl03, " ÊÝúÔv
hsl04 LIKE glt0-hsl04, " ÊÝúÔv
hsl05 LIKE glt0-hsl05, " ÊÝúÔv
hsl06 LIKE glt0-hsl06, " ÊÝúÔv
hsl07 LIKE glt0-hsl07, " ÊÝúÔv
hsl08 LIKE glt0-hsl08, " ÊÝúÔv
hsl09 LIKE glt0-hsl09, " ÊÝúÔv
hsl10 LIKE glt0-hsl10, " ÊÝúÔv
hsl11 LIKE glt0-hsl11, " ÊÝúÔv
hsl12 LIKE glt0-hsl12, " ÊÝúÔv
hsl13 LIKE glt0-hsl13, " ÊÝúÔv
hsl14 LIKE glt0-hsl14, " ÊÝúÔv
hsl15 LIKE glt0-hsl15, " ÊÝúÔv
hsl16 LIKE glt0-hsl16, " ÊÝúÔv
END OF gltz.
¡ IðæÊ
PARAMETERS:
P_RYEAR LIKE GLT0-RYEAR. "UÖÎÛÌïvNx
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_BUKRS1 LIKE BKPF-BUKRS default '200', "UÖ³ïÐR[h
P_GSBER1 LIKE BSEG-GSBER default '011A',
P_RACCT LIKE GLT0-RACCT.
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_BUKRS2 LIKE GLT0-BUKRS default '790', "UÖæïÐR[h
P_GSBER2 LIKE BSEG-GSBER default '130B'.
PARAMETERS:
W_BLART LIKE BKPF-BLART DEFAULT 'SA'. "`[^Cv
SELECTION-SCREEN SKIP 1.
PARAMETERS:
P_BUDAT LIKE BKPF-BUDAT. "UÖ`[]Lú
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TEXT-002 FOR FIELD XCALL.
PARAMETERS: XCALL LIKE RFPDO-RFBICALL. "eXgÀstO
SELECTION-SCREEN END OF LINE.
*¡ CHECKBOXÝè
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(33) TEXT-001 FOR FIELD P_TEST.
PARAMETERS: P_TEST AS CHECKBOX. "eXgÀstO
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN.
¡ e[uGLT0©çf[^ðæ¾
CLEAR GLTZ.
REFRESH GLTZ.
*¡ ¢Ï¾×ÇtO`FbN
SELECT SINGLE XOPVW INTO SKB1-XOPVW FROM SKB1
WHERE BUKRS = P_BUKRS1
AND SAKNR = P_RACCT.
*¡ G[bZ[W
IF SKB1-XOPVW = 'X'.
MESSAGE E002.
ENDIF.
SELECT * FROM GLT0
WHERE rldnr = '00' " ³ iÅèj
AND rrcty = '0' " R[h^CviÅèj
AND rvers = '001' " o[WiÅèj
AND racct = P_RACCT " ¨èR[h
AND bukrs = P_BUKRS1 " ïÐR[h
AND ryear = P_RYEAR. " ïvNx
MOVE-CORRESPONDING GLT0 TO GLTZ.
COLLECT GLTZ.
ENDSELECT.
¡ cðWv
LOOP AT GLTZ.
CNT = '0'.
SUM = GLTZ-HSLVT.
DO '16' TIMES.
CNT = CNT + 1.
FZ = 'GLTZ-HSL0'.
IF CNT > 9. "àµbmsÌlªXæèå«¢iQ jÈç
FZ+8 = CNT. "bmsÌlªeyÌW ÚÈ~ikÌãjÉüèÜ·B
ELSE. "àµbmsÌlªXȺiP jÈç
FZ+9 = CNT. "bmsÌlªeyÌX ÚÈ~iOÌãjÉüèÜ·B
ENDIF.
ASSIGN (FZ) to .
ENDDO.
ENDLOOP.
*¡ clª[ÌêAG[bZ[WðoÍ
IF SUM = 0.
MESSAGE E001 WITH 'clÍ[('0')Å·'.
ENDIF.
START-OF-SELECTION.
write 😕 'batch mode', sscrfields-ucomm.
¡ üÍæÊÌeXgtOªOFFÌêAclðoÍ
IF P_TEST <> 'X'.
SUM = SUM * 100.
SUMVAL = SUM.
¡ cf[^ÌoÍ
WRITE: AT / 'ïvNx F', P_RYEAR(4).
WRITE: AT / 'UÖ³ïÐR[hF', P_BUKRS1(4).
WRITE: AT / 'UÖ³¨èR[hF', P_RACCT+2(8).
WRITE: AT / 'ààzc F', SUMVAL DECIMALS 0, 'JPY'.
ELSE.
*¡cÌlª[È~Ìê
IF SUM < 0.
SUM = SUM * 100.
W_NEWBS1 = '40'.
W_NEWBS2 = '50'.
COMPUTE SUM = ABS( SUM ).
*¡ cÌlªPOSITIVEÌê
ELSE.
SUM = SUM * 100.
W_NEWBS1 = '50'.
W_NEWBS2 = '40'.
ENDIF.
IF XCALL = SPACE.
Write 'Its in batch input mode'.
PERFORM BATCHINPUTMODE. "ob`Cvgª
else.
write 'Its in Call transaction mode'.
Perform CTMODE.
endif.
ENDIF.
FORM BATCHINPUTMODE **************************************************
FB01 TRANSACTIONÌob`CvgSESSIONð쬷éB
************************************************************************
FORM BATCHINPUTMODE.
Perform open_group.
perform bdc_group.
perform bdc_transaction using 'FB01'.
perform close_group.
EndForm.
form BDC_GROUP.
*¡ ob`CvgW [Jn
perform bdc_dynpro using 'SAPMF05A' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BKPF-BLDAT'
P_BUDAT.
perform bdc_field using 'BKPF-BLART'
W_BLART.
perform bdc_field using 'BKPF-BUKRS'
P_BUKRS1.
perform bdc_field using 'BKPF-BUDAT'
P_BUDAT.
perform bdc_field using 'BKPF-WAERS'
'JPY'.
perform bdc_field using 'BKPF-XBLNR'
'QÆ`[Ô'.
perform bdc_field using 'BKPF-BKTXT'
'`[wb_ Text'.
perform bdc_field using 'RF05A-NEWBS'
W_NEWBS1.
perform bdc_field using 'RF05A-NEWKO'
P_RACCT.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=ZK'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BSEG-WRBTR'
SUM.
perform bdc_field using 'BSEG-ZUONR'
'[gL['.
perform bdc_field using 'BSEG-SGTXT'
'eLXg'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLKACB'
& ' 0001BLOCK'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'COBL-GSBER'
P_GSBER2.
perform bdc_field using 'BDC_SUBSCR'
'SAPLKACB'
& ' 0003BLOCK1'.
perform bdc_dynpro using 'SAPMF05A' '0330'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBK'.
perform bdc_field using 'BSEG-XREF1'
'QÆL[ 1'.
perform bdc_field using 'BSEG-XREF2'
'QÆL[ 2'.
perform bdc_field using 'BSEG-XREF3'
'QÆL[ 3'.
perform bdc_field using 'RF05A-NEWBS'
W_NEWBS2.
perform bdc_field using 'RF05A-NEWKO'
P_RACCT.
perform bdc_field using 'RF05A-NEWBK'
P_BUKRS2.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=ZK'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BSEG-WRBTR'
SUM.
perform bdc_field using 'BSEG-ZUONR'
'[gL['.
perform bdc_field using 'BSEG-SGTXT'
'eLXg'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLKACB'
& ' 0001BLOCK'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'COBL-GSBER'
P_GSBER2.
perform bdc_field using 'BDC_SUBSCR'
'SAPLKACB'
& ' 0003BLOCK1'.
perform bdc_dynpro using 'SAPMF05A' '0330'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-XREF3'.
perform bdc_field using 'BSEG-XREF1'
'QÆL[ 1'.
perform bdc_field using 'BSEG-XREF2'
'QÆL[ 2'.
perform bdc_field using 'BSEG-XREF3'
'QÆL[ 3'.
endform.
*&----
*
*& Form CallTransactionmode
*&----
*
text
*----
*
Form CTMODE.
perform bdc_group.
Call Transaction 'FB01'
using bdcdata
mode 'N'
update 'S'.
if sy-subrc ne 0.
perform open_group.
perform bdc_transaction using 'FB01'.
perform close_group.
write 😕 'Data Insufficient! Call transaction fails'.
write 😕 'Pls refer Batch Input Session !'.
else.
write 'Successfully Created Call transaction'.
endif.
ENDFORM. " CallTransactionmode
spool output is like this.
0000007530 05/02/22 13:51 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007529 05/02/22 13:51 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007528 05/02/22 13:51 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007527 05/02/22 13:51 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007526 05/02/22 13:51 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007525 05/02/22 13:50 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007524 05/02/22 13:50 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007523 05/02/22 13:50 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007522 05/02/22 13:50 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007521 05/02/22 13:50 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007520 05/02/22 13:49 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007519 05/02/22 13:49 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007518 05/02/22 13:49 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007517 05/02/22 13:49 - 1 LIST1S WIN1 ZGLT0_SHISAP
0000007516 05/02/22 13:49 - 1 LIST1S WIN1 ZGLT0_SHISAP
Message was edited by: ambi chan
Hello Ambichan,
Before we try to figure out why the job is getting scheduled <i><u>five</u></i> times, there are a few things that we need to find out.
1. When you call execute the CALL TRANSACTION statement, the sy-subrc statement must probably be non-zero. Please check out what the value of the SY-SUBRC is.
2. For the CALL TRANSACTION statement, please use the messages addition to see what messages you are getting when Call Transaction is failing. It will help you understand the error, which is most probably because of the error in data (in the BDC internal table).
3. Lastly, I see that you have written a lot of code in the AT SELECTION-SCREEN event. If I were in your place, I would not do that. Look at the SELECT and also the COLLECT statement. Can you move it to the start-of-selection block?
Regards,
Anand Mandalika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding ur question 1 and 2. i will reply later.
but regard qn 3, Why i did such calculation part at
"At selection" is,After the calculation i want to check the sum value and display the error part in INPUTTED screen itself.
Inorder to get the error display in INPUTTED screen itself i wrote in "At selection" part.
or else, if u write the same calcuation and error part at
Start-of -selection and execute, the error displays with blank screen(inputt fields gets disappeared in screen).
This is the reason i wrote there..
can we get the same behaviour at Start-of selection itself.
pls give me reference.
ambichan
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.