Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Loop at screen validation

Former Member
0 Likes
771

Dear All,

I have a mandatory field in material master (sal. org1 tab) which I have to set as non obligatory in PBO.

and its been done but when the user leaves to next tab or after the logic get executed it is again resetting it as

per customizing setting and when saving it is giving a message stating the field is marked as required and it has no entry.

I have done with normal Loop at screen.

loop at SCREEN.

if screen-name = 'MVKE-AUMNG'.

screen-required = 0.

MODIFY SCREEN.

endif.

endloop.

the solution I suggested is at customizing level make it as non obligatory and at screen level I can keep a error message.

But it will be helpful if I know why it is resetting and in any other way I can make it non obligatory until the screen get saved.

Thanks in advance,

Arun.

4 REPLIES 4
Read only

brad_bohn
Active Contributor
0 Likes
645

Set a watchpoint on SCREEN-NAME with your field as the value to find out where the required setting is being changed...

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
645

I hope you have used badi BADI_MAT_F_SPEC_SEL to do this.

Read only

Former Member
0 Likes
645

Hi Arun

i hope you are doing this when you click on sales org tab.

there must be a ok code defined for that tab and the screen number as well.

check the okcode or the screen number and then do your coding.

by doing so, whenever your screen will be called or that ok code will be performed , your code will get executed.

I hope this will help you

Thanks

LG

Read only

Former Member
0 Likes
645

Hi Arun,

Every time you will move to new tab or try to save the screen it will give you a error message because of your field is empty.

you can use the logic of memory importing and exporting, if user goes in that tab and does not fill the value you can take the screen number from memory and check that if it is not fill then by pass it.

In your logic each time you move from one tab to other or try to save it all variable got initialize so your logic at pbo is not effective. try to use that.


Data: gw_sel_tab               TYPE sy-dynnr.
Constants:   k_memory_id   TYPE char1           VALUE 'a'.


INITIALIZATION.
*         &- tabbed selection screen
  button1 = text-001.
  button2 = text-002.
  button3 = text-003.
*         &- subscreen
  mytab-prog = sy-repid.
*         &- subscreen number
  CLEAR : gw_sel_tab .   " Clear the variable for subscreen screen no

*  Import the subscreen number to memory.
  IMPORT gw_dynnr TO gw_sel_tab FROM MEMORY ID 'A'.
  FREE MEMORY ID k_memory_id.  " free memory ID k_memory_id.
 ***  Set the subscreen number as stored in Memory
  IF gw_sel_tab     = 200.
    mytab-dynnr     = 200.
    mytab-activetab = k_push2.
  ELSEIF gw_sel_tab = 300.
    mytab-dynnr     = 300.
    mytab-activetab = k_push3.
  ELSE.
    mytab-dynnr     = 100.
    mytab-activetab = k_push1.
  ENDIF.

START-OF-SELECTION.

*  &- data retrival based on tabbed selection screen
  CASE mytab-dynnr.
    WHEN 100.  " Referential tab
      EXPORT  gw_dynnr FROM mytab-dynnr TO MEMORY ID k_memory_id.
      You own code.
 Endcase.

I have given you a code for 3 tab screen. you can understand it from here.

You do not need to define gw_dyynr it is the value of your tab screen.

Thanks