‎2007 May 04 11:10 AM
Hello friends,
I have a req, at this time in the program a particular smartform is being called. I have to make the code likewise that depending upon the company-code another smartform should be called ?
Someone gave me hint, it could be done dynamically.....
Can any one, pls give me hint, or docu...
Regards,
‎2007 May 04 11:16 AM
Hi Shah,
Refer this code.
loop at itab.
if itab-bukrs = '0001'.
P_form = write heresmart form name
elseif itab-bukrs = '0002'.
p_form= ................
endif.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = P_FORM
IMPORTING
FM_NAME = P_FUNCTION
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION P_FUNCTION
TABLES
D_VBRK = IT_VBRK
D_VBRP = IT_VBRP
D_LIKP = IT_LIKP
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
reward points if helpful.
Regards,
Hemant
‎2007 May 04 11:19 AM
Hi Hemant,
Thanks for your help,
I am just woundring, ( as I have never worked with smartform before) how to fill the two forms ( as one form is already fillied , and depending upon I have to fill the other table )....
Regards,
‎2007 May 04 11:43 AM
Shah,
So you have opened a new thread.Fine,for ex if the sales org 200 in UK is having a window for tax and sales organisation 201 in US is not having any tax then you have to make this tax window invisible when executing the smartform for the sales org 201.
This thing you can validate using the field land1 in the table t005.
K.Kiran.
‎2007 May 04 11:21 AM
shah,
In your driver programe write the code in such a way that
if Bukrs = ' 001 '.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'(here u can specify ur form required for this company code.)
else..............
endif.
Hope this will help you