‎2009 May 23 4:14 PM
Dear all,
Im developing a customize dialog program. In my screen i have a TabScrip that contains 2 subscreens that subscreen1 contains 2 mandatory fields, and subscreen2 contains 3 mandatory fields. FYI these mandatory fields are being set as required field at screen attribute.
I'm facing below problem:
1. When Save button trigger (cursor is at subscreen1), system will not prompt for required input in subscreen2. May i know how should i code in order system prompt error msg for required input fields in subscreen2 ?
2. When i toggle from subscreen1 to subcreen2, system prompt me error msg for required input in subscreen1. I would like to get rid of the error msg, because i want my screen to be flexible that user can toggle in between tabstrip. Futhermore i want those mandatory fields to function when i click SAVE button. May i know how can i achieve the above?
Kindly comment.
‎2009 May 23 9:38 PM
Hi,
Your requirement is typical what paging in SAP GUI provides. Let me explain: you use separate subscreen areas for each of tab strip. In each of that subscreen areas you place separate subscreen. Now these subscreens are threated as there would be just one screen, so having mandatory fields on one of subscreens requires entering some data on it even though another subscreen is currently active.
Now considering your questions:
1) If you have mandatory fields at both of subscreens system will check all these fields (on both subscreens) against some entry when your trigger saving data
2) When you change tab (switch from one subscreen to another), there is not PAI triggered, therefore system will not ask you to put some data one the subscreen you are leaving (as it threads both of them as one subscreen).
Generally speaking, just picking paging in SAP GUI instead of paging at Application Server is excatly what you need. Please read this documentation: [tabstrips controls|http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/frameset.htm] in order to get further details. It explains both approaches and provides detials of their implementations.
Regards
Marcin
‎2009 May 23 5:46 PM
Hi,
As per your requirement, you need to put the validation in the Process After Input Event of the Screen. You need to handle the validation after the user triggers the save event in the screen. You can put a event in the PAI Event block with the Chain End Chain Statement for those fields which needs to apply these.
PROCESS AFTER INPUT.
CHAIN.
FIELD field_name MODULE module1.
FIELD field_name1 MODULE module2.
ENDCHAIN.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE init_screen_100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
FIELD input1 MODULE module_1.
FIELD input2 MODULE module_2.
FIELD input3 MODULE module_3.
CHAIN.
FIELD input4.
MODULE chain_module_1.
FIELD input5.
FIELD input6 MODULE chain_module_2.
ENDCHAIN.
MODULE EXECUTION.
You can have a look at the demo codes by typing DEMODYNPRO* in SE38. Also have a look at the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa4735c111d1829f0000e829fbfe/content.htm.
I guess with this approach you can solve both the problems with this approach. Let me know if you need any more details.
Hope this helps.
Thanks,
Samantak.
Edited by: Samantak Chatterjee on May 23, 2009 10:16 PM
Edited by: Samantak Chatterjee on May 23, 2009 11:13 PM
‎2009 May 23 9:38 PM
Hi,
Your requirement is typical what paging in SAP GUI provides. Let me explain: you use separate subscreen areas for each of tab strip. In each of that subscreen areas you place separate subscreen. Now these subscreens are threated as there would be just one screen, so having mandatory fields on one of subscreens requires entering some data on it even though another subscreen is currently active.
Now considering your questions:
1) If you have mandatory fields at both of subscreens system will check all these fields (on both subscreens) against some entry when your trigger saving data
2) When you change tab (switch from one subscreen to another), there is not PAI triggered, therefore system will not ask you to put some data one the subscreen you are leaving (as it threads both of them as one subscreen).
Generally speaking, just picking paging in SAP GUI instead of paging at Application Server is excatly what you need. Please read this documentation: [tabstrips controls|http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/frameset.htm] in order to get further details. It explains both approaches and provides detials of their implementations.
Regards
Marcin
‎2009 May 24 7:08 AM
Hi Marcin,
Thank you so much for your idea. Yup, it did work by using "paging in SAP GUI".
Now i only left one issue. That's when i'm in TAB2, after i key in input and press ENTER it always bring me back to TAB1.
Understand by using "paging in SAP GUI" system will not trigger PAI when changing TAB. Due to this i can't set my ACTIVETAB accrodingly.
So please comment again if above possible to be done?
Thanks in advance.
‎2009 May 24 8:31 AM
Changing tab doesn't trigger PAI, however making input (or choosing some other function like pressing pushbutton) does.
I guess you are initializing default activetab in PBO, right? When you make an input it triggeres dialog step (PAI->PBO), that is why your currently activetab is reinitialized in next PBO and eventually your end up in first tab each time.
Simply initialize activetab only once before PBO and system will take care of paging for you.
mytabstrip-activetab = 'PUSH1'. "by default we set first active
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
....
"but next time PBO is raised, activetab is set atuomatically, not by default value
ENDMODULE.
Hope this helps
Marcin
‎2009 May 24 8:41 AM
Hi Marcin,
You are so sharp by looking into my issue. Yes, you are right. I forgot the previous code that perform the re-initialization of the tab, where the ACTIVETAB is auto set by system each time.
Thank you again for your fast response and expert opinion.
‎2009 May 24 8:52 AM
Thanks for points, but right now I tried it myself and I think this won't solve your problem.
If you have two input enabled fields which are manadatory and each is placed on different tab, it always navigates to previous tab if you provide an entry in next tab.
This is how it really should work. Try to reverse the order, so enter some data in first tab and press enter. You will be paged to second tab and prompt to enter data there.
Now some explanation:
As mentioned in my first post, paging in SAP GUI treats all fields as they would be on one screen.
When you make an entry in one field and press ENTER, system recognize it as you would finish entering data and want to trigger PAI. But as with normal screens you can't accept your entires with ENTER unless you have filled all mandatory fields (here we just provided one of them). This is becuase automatic input check is triggered before custom code is exectued.
Here, as the fields are "on the same screen" you first have to provide an input for them all, then you have to press an ENTER key to accept that input. Comparing to normal scren with two mandatory fields, there is no difference in our example. We have only two different tabs, but the logic still remains the same.
So unfortunatelly you will always have to fill all mandatory fields before accepting than entry with ENTER. Otherwise system will look for remaining blanks and will navigate you there requiring your missing entry.
Sorry for not considering that before.
Regards
Marcin
‎2009 May 24 9:34 AM
Hi Marcin,
Thanks for your input again. What you explained is what i want to achieve. So there is no problem from your previous posts. Thanks again.
‎2009 May 24 3:22 AM
Hi,
For making the Field as mandatory below are the steps:
1.Open the Screen with the Screen Painter (SE51) on the Edit Mode.
2.Place the Curson on the Field
3.Double Click now.
4.You get a pop-up
5.Go to the TAB: "Program" of the Block "Attributes"
6.Check the Option "Input" and select "Required"
7.Activate and execute your program.
That's it.
Also,
Chain and Endchain are done on the Flow logic for further Validations on any fields.All the best.
Rgds,
Ramani N
‎2009 May 24 4:10 AM
Hi Ramani,
Sorry!! I do not see any relation between the poster's question and ur answer!!!
thanq