12-07-2021 12:16 PM
Hiii,
I have to fetch the smartform name from the table TNAPR and pass it to the FM SSF_FUNCTION_MODULE_NAME.
Can someone tell me how to do a select query so that I'll get the appropriate form name.
Thanks and regards,
Lydia Martin..
12-16-2021 6:43 PM
Do not know what the requirement is but if you know the conditions to specify the exact row you want in TNAPR, here is a sample code you can refer to. Fields KSCHL,NACHA,KAPPL are used here to make the fetched data unique but please replace with your own conditions. In this case smartform LE_TRA_CONF_STAT is fetched and its FM name is stored in LV_FM_NAME.
DATA:LV_SMARTFORM TYPE TNAPR-SFORM,
LV_FM_NAME TYPE RS38L_FNAM.
SELECT SINGLE SFORM
FROM TNAPR
INTO LV_SMARTFORM
WHERE KSCHL = 'CPAC'
AND NACHA = '5'
AND KAPPL = 'V7'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = LV_SMARTFORM
IMPORTING
FM_NAME = LV_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
If this did not solve it, let me know your requirement in detail.12-07-2021 12:21 PM
Lydia, don't write text in upper case
the TNAPR table is managed by the standard, SAP call from this customizing a print program with a form name. You just have to be here, and you will find in memory this information.
What is the object you would like to print ?
12-07-2021 12:26 PM
12-07-2021 12:53 PM
There are hundreds of "repair" reports in S/4HANA. Please be precise.
12-16-2021 6:43 PM
Do not know what the requirement is but if you know the conditions to specify the exact row you want in TNAPR, here is a sample code you can refer to. Fields KSCHL,NACHA,KAPPL are used here to make the fetched data unique but please replace with your own conditions. In this case smartform LE_TRA_CONF_STAT is fetched and its FM name is stored in LV_FM_NAME.
DATA:LV_SMARTFORM TYPE TNAPR-SFORM,
LV_FM_NAME TYPE RS38L_FNAM.
SELECT SINGLE SFORM
FROM TNAPR
INTO LV_SMARTFORM
WHERE KSCHL = 'CPAC'
AND NACHA = '5'
AND KAPPL = 'V7'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = LV_SMARTFORM
IMPORTING
FM_NAME = LV_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
If this did not solve it, let me know your requirement in detail.12-23-2021 7:48 AM
12-16-2021 7:22 PM
The concerned line of TNAPR is stored in the "Tables Work Area" memory (kind of shared memory), you should be able to get it implicitly in your program or smart form by just declaring its name with "TABLES", and after that, you may access its components:
TABLES tnapr.
...
DATA(smart_form_name) = tnapr-sform.