Application Development 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: 

MODULE POOL

Former Member
0 Kudos

Hi ,

I have created a screen which has 6 mandatory fields.

Now in the same screen i have to use search button , which 'll fetch data from db if one field value is given ...

The prob is whn i am searching it is asking me to fill the mandatory fields first ..

I tried to use search command in at exit-command module ,

in tht case it is not reading the values on to the screen

plz help me

thanks

ramesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You would have to always fill mandatory fields. Is it possible to make fields ordinary(Not mandatory).

At exit command is also a PAI module which would trigger on any event.

Have you used the same name as of screen elements?

Regards

Manish

10 REPLIES 10

Former Member
0 Kudos

Hi

You would have to always fill mandatory fields. Is it possible to make fields ordinary(Not mandatory).

At exit command is also a PAI module which would trigger on any event.

Have you used the same name as of screen elements?

Regards

Manish

varma_narayana
Active Contributor
0 Kudos

Hi Ramesh.

I got ur Probelm:

Basically in AT EXIT-Command Module the Screen Field values are not transported to the Program variables.

So We need to call the FM DYNP_VALUES_READ to Read the Values explicitly.

This FM returns the Values of Screen fields .

Sample code:

DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.

dynfields-fieldname = 'P_VBELN'. "Append The Screen Filed names

APPEND dynfields.

**Read the Values of the SCREEN FIELDs

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = dynfields "Reurns the Values of the Screen fields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11.

<b>REWARD IF helpful.</b>

Former Member
0 Kudos

Thanka for the responce ..

Actually i used the fm to read the values from screen to program ...

Now i want to send the values from program to screen...

pls send if thr z any othr fn module for tht

0 Kudos

Hi Ramesh..

To send the Values from program to Screen we have the FM

DYNP_VALUES_UPDATE.

<b>reward if Helpful.</b>

former_member491305
Active Contributor
0 Kudos

Hi ,

Your approach is right.Just u have to use DYNP_VALUES_UPDATE Function Module to transfer the field values to the screen .

Former Member
0 Kudos

HI

THIS FM dynpro_values_update not sending the values to screen..

0 Kudos

HEY VARMA PLS SEND ANY SAMPLE CODE IF U HAVE .. I DONNO WHR I AM GOIN WRONG

0 Kudos

Hi Ramesh,

DYNP_VALUES_UPADTE will definetly work.Just check it in Debugging mode whether You r passing the value to the field and also check the sy-subrc value after that Function Module is processed.It should be Zero.If it still not working,Then paste ur code here.

0 Kudos

Hi,

Check out this code.

SELECT SINGLE zparameter_text

zcreated_dt

FROM zest_com_par_mas

INTO (s_paratext,s_creon)

WHERE zobject_type = s_objtype

AND zparameter_id = s_paraid

AND zdeletion_flag NE 'X'.

REFRESH it_dynpfields2.

x_dynpfields2-fieldname = 'S_PARATEXT'.

x_dynpfields2-fieldvalue = s_paratext.

APPEND x_dynpfields2 to it_dynpfields2.

x_dynpfields2-fieldname = 'S_CREON'.

x_dynpfields2-fieldvalue = s_creon.

APPEND x_dynpfields2 to it_dynpfields2.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'SAPMZ_EST_TOOL'

dynumb = '9014'

TABLES

dynpfields = it_dynpfields2

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

Message was edited by:

Vigneswaran S

0 Kudos

Hi

This is the way to call it.

CLEAR: DYFIELDS.

DYFIELDS-FIELDNAME = 'P_RADIO'. "Screen field

DYFIELDS-FIELDVALUE = '1000'.

*DYFIELDS-STEPL = l_stepl.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = SY-CPROG

dynumb = SY-DYNNR

tables

dynpfields = DYFIELDS

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

INVALID_REQUEST = 5

NO_FIELDDESCRIPTION = 6

UNDEFIND_ERROR = 7

OTHERS = 8

.

REWARD IF HELPFUL.