Uploaded by Ashish Panwar

Abap Debugging

advertisement
Requirement: There are some postings which will be created during the month end execution of reports,
related to classic GL reports. In CFIN we have new GL in S4. It creates some doc at the end so we don’t
want these docs to be posted since it will be a duplicate entry hence functional will mark it as error docs.
So, when it goes to AIF it will show as error and hence, they can ignore.
Now the no of errors will grow, so we have to do some housekeeping in AIF by marking them as cancel
and some archiving team will decide when to delete the cancel msgs as part of the housekeeping of
system.
Now we have to make a custom report to get the docs which are in cancel status.
We will be filtering out this data in SLT itself, but since the team needs the data for reconciliation
purpose, they are sending the data across CFIN system.
So now we are checking the same for S94 system.
Filter condition:
System SAPF180/181 Logic
PCA Adjustment Logic
CHGSAP
LOGSYSTEM_SENDER=X31*
BLART=SA/SE
XBLNR=SAPF*
Message: “CHGSAP SAPF180/181 Adjustment
Posting”
There is one program which balances PCA to FI but these ae PCA
only entries. No FI Document is created. No Logic needed for this
case.
GSAP
LOGSYSTEM_SENDER=X94*
BLART=SU
XBLNR=SAPF*
Message: “GSAP SAPF180/181 Adjustment
Posting”
LOGSYSTEM_SENDER=X94*
BLART=SU
TCODE= /DS1/FI_C_PCBAL
Message: “GSAP PCA Balancing Posting”
Steps:
1.
2.
3.
4.
5.
6.
Deactivate the MT ID as replication is in progress
Expert function -> Create predefined filter (copy the filter conditions, if any)
Delete the conversion objects.
Delete the Load/ replication object.
Recreate the conversion object and add the filter condition which were previously there.
Add the extra filter condition for the above filter provided.
**-------- SKIP SAPF180/181 and PCA Balancing Posting----------*
IF ( <WA_S_CFIN_ACCIT>-BLART = 'SU' AND <WA_S_CFIN_ACCIT>-XBLNR(4) =
'SAPF' ) OR ( <WA_S_CFIN_ACCIT>-BLART = 'SU' AND <WA_S_CFIN_ACCHD>TCODE
= '/DS1/FI_C_PCBAL' ).
SKIP_TRANSACTION.
ENDIF.
7. Now to debug, we must put some breakpoint, so write the logic before your filter condition.
8. Put an endless less by writing Do and Enddo loop.
DO.
IF SY-TABIX > 1
EXIT.
ENDIF.
ENDDO.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
Now, by specifying the condition in between DO and ENDDO we are telling the program to come
out of the loop once the condition satisfies. So, for first record, it will go inside the DO loop but
for second record it will go inside the loop but will exit as the condition SY-TABIX > 1 satisfies.
If we do not mention the condition in between the DO and ENDDO, we will have to manually
come out of the loop every time.
Save the rule and check the filter condition (just to cross verify)
Go to migration object -> Change -> 7 step Generate runtime object and run it.
Now check the function group if the filter condition if reflecting or not.
Activate the MT ID.
Go to SM50 -> active workprocess only
Select the row running for that functional module
Administration -> program -> debugging
Now your program will stop at DO and ENDDO loop
Now since we are checking the condition for first record so the condition mentioned in between
the Do and EDDO will not satisfy and hence it will be in endless loop. So, to come out of the loop
we have to follow as below.
Pt the cursor at the line where you want the execution to start (usually the next execution line
after the DO ENDDO loop)
Go to Debugger -> Go to statement, your cursor will automatically jump here
Now check the conditions (records pertaining to those values), if its correct or not.
So now, to go inside the execution program, click on F5 and if the condition meets, the
transaction should be skipped.
Now put a breakpoint again to the same condition so that next time when it runs for second
records, it automatically jumps to the same condition.
Click F8, now it will not go to DO and ENDDO as SYS-TABIX > 1. So, it will directly come to your
filter condition where we have set our breakpoint
If we don’t put the Filter condition in between the DO and ENDDO, then we will have to come
again and again to SM50 and start the debugging session for each record. Make sure to put
breakpoint at DO condition, so that program does not go in endless loop for the second record.
So, by this, the execution will stop at DO and we can manually put a go to statement on the next
execution line after the loop.
Related documents
Download