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

How could i Clear the parameter value once select the first parameter value using f4

former_member196331
Active Contributor
0 Likes
3,097

Hi,

I need Small information.

I have two Parameters, In My Selection Screen. Both are i need to select value  from the  Method F4IF_INT_TABLE_VALUE_REQUEST

Values are coming and  Everything is fine. Small logic it is having. I am selecting the first parameter . then i come to second parameter.

I need to pass the value parameter of first selection parameter to the second parameter sql query.

Here what i need is  After select the first parameter value , I would like to clear the second parameter value (Previously what i selected from f4)

''The below code is for first parameter, Second parameter is also same thing like this.

   Below bold color code i used for clear the values for  second parameter, If i put the break points  values are clearing.

   but it is not reflect to the front end means at selection Screen.

   Can any body tell me how could i clear the values to the Selection Screen.

I used even selection-screen output also but it is not triggering ,After select the first parameter.

selection screen output is triggering at the time of starting the code.

AT SELECTION-SCREEN OUTPUT.

   LOOP AT SCREEN.

     CASE P_VBELN.

      CLEAR: P_VBELP.

         ENDCASE.

          ENDLOOP.

Above code not working. Triggers at the time of starting Only.

 

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

   REFRESHIT_ERNAM.

   SELECT DISTINCT VBELN FROM EKKN INTO TABLE IT_ERNAM.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_vbeln'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_ERNAM

       RETURN_TAB      = IT_RETURN1

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELN = IT_RETURN1-FIELDVAL.


  CLEAR: P_VBELP.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELP.

   REFRESH:IT_MATNR.

   SELECT DISTINCT VBELP FROM EKKN INTO TABLE IT_MATNR WHERE VBELN P_VBELN.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_VBELP'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_MATNR

       RETURN_TAB      = IT_RETURN2

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELP = IT_RETURN2-FIELDVAL.

1 ACCEPTED SOLUTION
Read only

dibyajeeban_jena
Active Participant
0 Likes
3,062

Hi ,

Here is the solution..Use FM 'DYNP_VALUES_UPDATE' , 

Please the below code in place of  'Clear : p_vbelp' (in bold above) in your code .

DATA : it_dyn TYPE TABLE OF dynpread ,
             WA_DYN
TYPE DYNPREAD.

WA_DYN-FIELDNAME = 'P_VBELN' .

WA_DYN
-FIELDVALUE = it_return1-FIELDVAL.

APPEND WA_DYN TO IT_DYN.



WA_DYN
-FIELDNAME = 'P_VBELP' .

WA_DYN
-FIELDVALUE = '   '.

APPEND WA_DYN TO IT_DYN.



 
CALL FUNCTION 'DYNP_VALUES_UPDATE'

   
EXPORTING

      dyname    
= sy-repid

      dynumb    
= sy-dynnr

   
TABLES

      dynpfields
= it_dyn.

 
IF sy-subrc <> 0.

* Implement suitable error handling here

 
ENDIF.

Regards

DJ

Hi,

I need Small information.

I have two Parameters, In My Selection Screen. Both are i need to select value  from the  Method F4IF_INT_TABLE_VALUE_REQUEST

Values are coming and  Everything is fine. Small logic it is having. I am selecting the first parameter . then i come to second parameter.

I need to pass the value parameter of first selection parameter to the second parameter sql query.

Here what i need is  After select the first parameter value , I would like to clear the second parameter value (Previously what i selected from f4)

''The below code is for first parameter, Second parameter is also same thing like this.

   Below bold color code i used for clear the values for  second parameter, If i put the break points  values are clearing.

   but it is not reflect to the front end means at selection Screen.

   Can any body tell me how could i clear the values to the Selection Screen.

I used even selection-screen output also but it is not triggering ,After select the first parameter.

selection screen output is triggering at the time of starting the code.

AT SELECTION-SCREEN OUTPUT.

   LOOP AT SCREEN.

     CASE P_VBELN.

      CLEAR: P_VBELP.

         ENDCASE.

          ENDLOOP.

Above code not working. Triggers at the time of starting Only.

 

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

   REFRESHIT_ERNAM.

   SELECT DISTINCT VBELN FROM EKKN INTO TABLE IT_ERNAM.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_vbeln'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_ERNAM

       RETURN_TAB      = IT_RETURN1

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELN = IT_RETURN1-FIELDVAL.


  CLEAR: P_VBELP.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELP.

   REFRESH:IT_MATNR.

   SELECT DISTINCT VBELP FROM EKKN INTO TABLE IT_MATNR WHERE VBELN P_VBELN.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_VBELP'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_MATNR

       RETURN_TAB      = IT_RETURN2

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELP = IT_RETURN2-FIELDVAL.

10 REPLIES 10
Read only

Former Member
0 Likes
3,062

hi,

please try it.

PARAMETER : p_vbelp TYPE per_amt  MODIF ID gp1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

   REFRESHIT_ERNAM.

   SELECT DISTINCT VBELN FROM EKKN INTO TABLE IT_ERNAM.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_vbeln'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_ERNAM

       RETURN_TAB      = IT_RETURN1

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELN = IT_RETURN1-FIELDVAL.


if sy=subrc = 0.

LOOP AT SCREEN.

    

          IF screen-group1 = 'GP1'.

        

         CLEAR val.

       ENDIF.

        MODIFY SCREEN.

   ENDLOOP.


endif.


Read only

0 Likes
3,062

Thanks for your reply.

Still same problem. I put the break point please have a look on below attached image.

code is triggering. value becomes 0000 . But But it is not reflecting to the front end.

I mean selection screen remains same. What i selected previous value from the F4

Any Information Please update me.

Read only

Former Member
0 Likes
3,062

Hi,

You need to clear the variable P_VBELP at event 'AT SELECTION SCREEN'.

AT SELECTION SCREEN.

CLEAR : P_VBELP.

Thanks.

Regards,

Suniel

Read only

0 Likes
3,062

HI,

Thanks for your reply.

I put the code before the value request but it is not firing...

May i know how could i use it.

I seen below thread. They used before the value requested i used the same way but not firing.

At selection-screen.

   CLEAR : P_VBELP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

   REFRESHIT_ERNAM.

   SELECT DISTINCT VBELN FROM EKKN INTO TABLE IT_ERNAM.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       RETFIELD        = 'P_vbeln'

       VALUE_ORG       = 'S'

     TABLES

       VALUE_TAB       = IT_ERNAM

       RETURN_TAB      = IT_RETURN1

     EXCEPTIONS

       PARAMETER_ERROR = 1

       NO_VALUES_FOUND = 2

       OTHERS          = 3.

   P_VBELN = IT_RETURN1-FIELDVAL.

*  CLEAR: P_VBELP.

   IF SY-SUBRC = 0.

     LOOP AT SCREEN.

       IF SCREEN-GROUP1 = 'GP1'.

         CLEAR P_VBELP.

       ENDIF.

       MODIFY SCREEN.

     ENDLOOP.

   ENDIF.

     CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

       EXPORTING

         INPUT  = P_VBELN

       IMPORTING

         OUTPUT = P_VBELN.

Read only

0 Likes
3,062

It's firing. Before  coming the output .

But i need Once select the first parameter then i need to make it empty.

Read only

0 Likes
3,062

Hi,

just add the if condition to check the variable is empty or not.

AT SELECTION-SCREEN.

IF P_VBELN IS NOT INITIAL  AND P_VBELP IS NOT INITIAL.

CLEAR : P_VBELP.

ENDIF.

Thanks.

Regards,

Suniel.

Read only

0 Likes
3,062

Hi,

Thanks for your reply.

First it is not firing. Before coming the output only it is coming.

I need Once select the first parameter then only i need to validate.

Read only

dibyajeeban_jena
Active Participant
0 Likes
3,063

Hi ,

Here is the solution..Use FM 'DYNP_VALUES_UPDATE' , 

Please the below code in place of  'Clear : p_vbelp' (in bold above) in your code .

DATA : it_dyn TYPE TABLE OF dynpread ,
             WA_DYN
TYPE DYNPREAD.

WA_DYN-FIELDNAME = 'P_VBELN' .

WA_DYN
-FIELDVALUE = it_return1-FIELDVAL.

APPEND WA_DYN TO IT_DYN.



WA_DYN
-FIELDNAME = 'P_VBELP' .

WA_DYN
-FIELDVALUE = '   '.

APPEND WA_DYN TO IT_DYN.



 
CALL FUNCTION 'DYNP_VALUES_UPDATE'

   
EXPORTING

      dyname    
= sy-repid

      dynumb    
= sy-dynnr

   
TABLES

      dynpfields
= it_dyn.

 
IF sy-subrc <> 0.

* Implement suitable error handling here

 
ENDIF.

Regards

DJ

Read only

0 Likes
3,062

hi,

Thanks for your reply.

Point Noted. Give me some time i will check it and Update to u.

Read only

0 Likes
3,062

Thank u, never heard  this type of Function Module.

keep posting.

Thank u.