Hi SAP Gurus,
I've developed a "caller" program that calls other programs using SUBMIT <REPORT>, and inserts a header before & a footer after the report body.
So first I would call a report from my main "caller" program =
SUBMIT (REPORT)
USING SELECTION-SET P_VARI
LINE-COUNT P_LINCT
EXPORTING LIST TO MEMORY AND RETURN.
Then I'll get the ABAP List back from memory using FM "LIST_FROM_MEMORY" and write the output using FM "WRITE_LIST".
Everything works fine.
Now there's an ALV report that the user wants to call using this main "caller" program.
This ALV report calls "TOP-OF-PAGE" event, in which it would display the Page Number.
If this ALV report is executed on its own, everything works fine, the page number would increase correctly for each new page generated.
But if this ALV report is being called from my main "caller" program using SUBMIT <REPORT> then the page number would always be = 1.
So I would have like 100 pages of report ( ALV ), but the page number in all the pages would always be = 1.
Inside the called ALV program, I have tried to use both a STATIC variable for the page number and SY-PAGNO, but still the page number is always = 1 on every page.
Any pointer here what I could be missing ?
Appreciate your help very much 😊
Please help !