2007 Jan 05 3:06 PM
Hi,
My requirement is to place a radiobutton on the selection screen. when user selects this radio button and execute, he should be shown the selection screen of a query defined in SQ00. So I went to SQ00 and gave the query and executed. I was show a selection screen then I went to system > status and looked at the program name. It is AQL4Z_PURCHASELUMBERPOHT==. What is the ending '=='s? I think this program is auto generated. Can I use Submit with this report program? If I use this and if the selection screen is chaged then will this program name also changes? Please suggest me or any better way to achieve this requirement. Let me know if you need more information.
thank you,
surya.
2007 Jan 05 9:45 PM
Hi Surya,
Try this eventhough it is not pretty (is Friday).
...
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = l_wsid
USERGROUP = l_bgrup
QUERY = l_quold
IMPORTING
REPORTNAME = l_reptname.
l_reptname+2(2) = '%'.
CONDENSE l_reptname NO-GAPS.
data: l_name like trdir-name.
clear l_name.
SELECT SINGLE NAME
INTO L_NAME
FROM TRDIR
WHERE NAME LIKE l_reptname.
IF SY-SUBRC <> 0.
STOP.
ELSE.
MOVE L_NAME TO l_reptname.
ENDIF.
CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
EXPORTING
QUERYREPORT = l_reptname
VARIANTE = ''
EXCEPTIONS
ONLY_WITH_VARIANT = 1
VARIANT_NOT_EXIST = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
Hi,
My requirement is to place a radiobutton on the selection screen. when user selects this radio button and execute, he should be shown the selection screen of a query defined in SQ00. So I went to SQ00 and gave the query and executed. I was show a selection screen then I went to system > status and looked at the program name. It is AQL4Z_PURCHASELUMBERPOHT==. What is the ending '=='s? I think this program is auto generated. Can I use Submit with this report program? If I use this and if the selection screen is chaged then will this program name also changes? Please suggest me or any better way to achieve this requirement. Let me know if you need more information.
thank you,
surya.
2007 Jan 05 3:11 PM
AQL4Z_PURCHASELUMBERPOHT== is the naming convention for querys, for example, in the following program name, BASIS is the user group and USER_LOGIN is the query name. As long as these two things do not change, then the program name will always be the same and you can call it using the SUBMIT statement in your program.
AQFKBASIS=======USER_LOGIN====
Regards,
Rich Heilman
2007 Jan 05 3:20 PM
Hi Surya,
You can use FM RSAQ_REPORT_NAME to find out the query/report name based on user group and query name.
Then you can submit the query/report name.
Hope this will help.
Regards,
Ferry Lianto
2007 Jan 05 4:06 PM
Hi Ferry,
I just saw this function module, what value I should be passing to the 'workspace' parameter?
Thank you,
Surya.
2007 Jan 05 4:07 PM
2007 Jan 05 6:41 PM
Hi Ferry,
It worked and getting report name but when call that report using submit it is giving a dump saying Program '......' not found. Any clue ?
Thank you,
Surya.
2007 Jan 05 7:01 PM
Hi Surya,
Please use this FM RSAQ_SUBMIT_QUERY_REPORT to run the query/report name. You can leave parameter VARIANTE blank.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2007 Jan 05 7:15 PM
Hi Ferry,
I used it and giving me the same dump. Following is my code.
FORM open_query using l_wsid
l_bgrup
l_quold
changing l_reptname .
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = l_wsid
USERGROUP = l_bgrup
QUERY = l_quold
IMPORTING
REPORTNAME = l_reptname
.
CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
EXPORTING
QUERYREPORT = l_reptname
VARIANTE = ''
EXCEPTIONS
ONLY_WITH_VARIANT = 1
VARIANT_NOT_EXIST = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
submit (l_reptname). "ZFI_AGING_REPORT.
ENDFORM.
2007 Jan 05 7:44 PM
Hi Surya,
Please try to add this.
...
move 'ZZ' to l_wsid.
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = l_wsid
USERGROUP = l_bgrup
QUERY = l_quold
IMPORTING
REPORTNAME = l_reptname.
...
Regards,
Ferry Lianto
2007 Jan 05 8:21 PM
Hi Ferry,
I tried this too. No luck! Only difference is report names, earlier it is AQFJZ_PURCHASINGLUMBERPOHIST==
and after passing 'ZZ' worspace the report name is
AQZZZ_PURCHASINGLUMBERPOHIST==
-Thank you,
Surya
2007 Jan 05 8:37 PM
Hi Surya,
Sorry ... try this.
move 'G' to l_wsid.
Regards.
Ferry Lianto
2007 Jan 05 9:17 PM
Hi Ferry,
I tried passing G. Same dump. But I observed that any thing other than space I pass it is giving the report name as AQZZZ_PURCHASINGLUMBERPOHIST==
Also the report names in dev and test are different i.e 3 and 4 characters. I am guessing if could able to find and pass right workspace, then this problem will be solved. Please let me know your comments.
Thank you,
Surya
2007 Jan 05 9:45 PM
Hi Surya,
Try this eventhough it is not pretty (is Friday).
...
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = l_wsid
USERGROUP = l_bgrup
QUERY = l_quold
IMPORTING
REPORTNAME = l_reptname.
l_reptname+2(2) = '%'.
CONDENSE l_reptname NO-GAPS.
data: l_name like trdir-name.
clear l_name.
SELECT SINGLE NAME
INTO L_NAME
FROM TRDIR
WHERE NAME LIKE l_reptname.
IF SY-SUBRC <> 0.
STOP.
ELSE.
MOVE L_NAME TO l_reptname.
ENDIF.
CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
EXPORTING
QUERYREPORT = l_reptname
VARIANTE = ''
EXCEPTIONS
ONLY_WITH_VARIANT = 1
VARIANT_NOT_EXIST = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this will help.
Regards,
Ferry Lianto
2007 Jan 05 10:21 PM
Hi Ferry,
This worked. Your help is appriciated and you scored full points. Have a nice weekend.
Thank you,
Surya.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |