‎2013 Oct 14 6:38 AM
Hi everybody,
I want to create a smartform with 2 pages.
i want to get the either of the page get called conditionally..
for example.
if material number starts with 11 the page 1 should get called
and if material number gets starts with 31 then page 2 should get called.
Is this possible.
‎2013 Oct 14 7:25 AM
hi Kumar,
Please use Program Lines in your first page and check if the MATNR starts with 31 and set FLAG_NEXT = 'X'. Now call NEXT PAGE with condition maintained as FLAG_NEXT = 'X'.
In above scenario if the MATNR doesnt start with 31 (ie 11 matnr) then ur flag will be blank hence condition to call next page will fail and your current page would be (called) processed.
Please revert if still doubts.
Regards,
DN.
‎2013 Oct 15 8:02 AM
Hi,
Create two pages in the smartform.
In the first page, Use Program lines to check the material no start with 31 or not and If it starts with 31 then set a flag = 'X'. Create a Command and in the general attributes set go to page as PAGE2 if flag = 'X' .
‎2013 Oct 15 8:57 AM
Hi kumar chaudhari,
In the Smartform Form Interface, there is parameter called
CONTROL_PARAMETERS.
In this structure you can pass the control parameters for the samrtform like the STARTPAGE of the SmartForm, and whether to show PREVIEW of the output etc.,,
Just have a condition in you Print(Driver) program as below before calling the SmartForm and pass the control parameters to the form Interface.
IF material number starts with 11.
CONTROL_PARAMETERS-STARTPAGE = 'PAGE1'.
ELSEIF material number gets starts with 31.
CONTROL_PARAMETERS-STARTPAGE = 'PAGE2'.
ENDIF.
* CALL YOUR Smartform
CALL FUNCTION Smartform_fm
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL_PARAMETERS
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
Hope it will help you.
Thank you.
Regards,
Narayana Reddy A V L..
‎2013 Oct 15 9:52 AM
‎2013 Oct 15 10:03 AM
‎2013 Oct 15 10:14 AM
Hi Kumar,
Apologies!!!
May I know the run time error description that you are getting.
If possible can you please share the screenshot of the Smartform(With Pages you have created) and the code.
Regards,
Narayana Reddy A V L.
‎2013 Oct 15 10:27 AM
Hi Kumar,
Just want to make clear that whether you have passed the page names of the First and Second pages of your SmartForm to the control parameters.
Lets say I have two pages in my smartform as follows with names FIRST and NEXT.
code should be as follows(Use Page names - Not "PAGE1" and "PAGE2"):
IF material number starts with 11.
CONTROL_PARAMETERS-STARTPAGE = 'FIRST'.
ELSEIF material number gets starts with 31.
CONTROL_PARAMETERS-STARTPAGE = 'NEXT'.
ENDIF.
Regards,
Narayana Reddy A V L.
‎2013 Oct 15 11:09 AM
Hi,
As Narayana Reddy mentioned above you can use the control parameter, it will work fine check the input passing to the FM .
Check this out, here the smartform contain 2 page with main window and a secondary window.
DATA: cp TYPE ssfctrlop,
v_no TYPE matnr VALUE '113634'.
SHIFT v_no LEFT DELETING LEADING '0'.
IF v_no(2) EQ 11.
cp-startpage = 'PAGE1'.
ELSEIF v_no(2) EQ 22.
cp-startpage = 'PAGE2'.
ENDIF.
"""""Use the Output of FM 'SSF_FUNCTION_MODULE_NAME' to call smartform.
CALL FUNCTION '/1BCDWB/SF00000401'
EXPORTING
control_parameters = cp
matnr = v_no.
‎2013 Oct 15 11:54 AM
Hi,
This is another post of the same question ?
See Here
http://scn.sap.com/message/14437535#14437535
Regards.