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

Screen validation

Former Member
0 Likes
1,408

Hi,

I have given material number and unit in the selection screen.

After entering material number I want to display the corresponding unit also with out pressing enter button I mean with out doing any user interaction I want to show the unit also in the selection screen. Can any one give idea on this?

Thanks a lot in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,368

Hi Babji,

See the Standard Program demo_dynpro_f4_help_module In SE38.

Plzz Reward if it is Helpful,

Mahi.

13 REPLIES 13
Read only

Former Member
0 Likes
1,368

Hi,

U can achieve this by using at selection screen output.

read the value of the select option using FM. (i suppose dyn_value_read). Based on this value, hit the database and fetch the value of unit. update using FM (dyn_value_update).

Reward points if useful,

Regards,

Niyaz

Read only

0 Likes
1,368

Hi,

Thanks for your reply. If possible can you send me the sample code for this. I will give points.

Thanks.

Read only

Former Member
0 Likes
1,368

Hi Babji,

I have a Program with same sinario use this code.

In that i want object ID with Corresponding Project ID.

Try Like this code

REPORT ZCL120_F4HELP.

DATA: BEGIN OF values,

OID TYPE ZCL_OBJECT-OBJECTID,

ODEC TYPE ZCL_OBJECT-OBJECTDESC,

END OF values,

W_FIELD(10).

DATA: ZCL_PROJECT-PROJECTID type zcl_project-projectid,

ZCL_OBJECT-OBJECTID(5).

DATA: progname TYPE sy-repid,

dynnum TYPE sy-dynnr,

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values,

values_tab LIKE TABLE OF values.

CALL SCREEN 100.

&----


*& Module VALUE_OBJECTID INPUT

&----


  • text

----


MODULE VALUE_OBJECTID INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = progname

dynumb = dynnum

translate_to_upper = 'X'

TABLES

dynpfields = dynpro_values.

READ TABLE dynpro_values INDEX 1 INTO field_value.

W_FIELD = FIELD_VALUE-FIELDVALUE.

SELECT OBJECTID

OBJECTDESC

FROM ZCL_OBJECT

INTO (VALUES-OID,

VALUES-ODEC)

WHERE PROJECTID = FIELD_VALUE-FIELDVALUE.

APPEND VALUES TO VALUES_TAB.

ENDSELECT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'OID'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'ZCL_OBJECT-OBJECTID'

value_org = 'S'

TABLES

value_tab = values_tab.

ENDMODULE. " VALUE_OBJECTID INPUT

&----


*& Module INIT OUTPUT

&----


  • text

----


MODULE INIT OUTPUT.

progname = sy-repid.

dynnum = sy-dynnr.

CLEAR: field_value, dynpro_values.

field_value-fieldname = 'ZCL_PROJECT-PROJECTID'.

APPEND field_value TO dynpro_values.

IF SY-UCOMM = 'BACK'.

LEAVE program.

ENDIF.

IF SY-UCOMM = 'ANS'.

LEAVE TO SCREEN '0'.

ENDIF.

ENDMODULE. " INIT OUTPUT

OR Simply see the Standard PROGRAM demo_dynpro_f4_help_module In SE38

Plzz Reward if it is useful,

Mahi.

Read only

Former Member
0 Likes
1,369

Hi Babji,

See the Standard Program demo_dynpro_f4_help_module In SE38.

Plzz Reward if it is Helpful,

Mahi.

Read only

0 Likes
1,368

Hi thanks a lot for your replys.

is it possible to insert the same logic in normal report program. Can i use at selection screen output event?

Thanks.

Read only

0 Likes
1,368

Hi Babji,

Yes it is obsalutly Posible.

Plzz Reward if it is useful,

Mahi.

Read only

0 Likes
1,368

Hi i saw that logic but with out pressing enter i need to display unit value in the selection screen. After entering material number immediately i need to display unit value in the selection screen with out pressing any thing even enter.

in between material and unit one more field is ther that is quantity and that is mandatory field.

Thanks a lot.

Read only

0 Likes
1,368

Hi Babji

The function module DYNP_VALUES_READ is used for read screen values with out triggring any action to user bu using this function module we can read screen values and based on the value we can do any thing .

If you want the logic rly me.

Plzz Reward if it is useful,

Mahi.

Read only

0 Likes
1,368

Hi,

If possible can you please send the logic with events.

Thanks .

Read only

0 Likes
1,368

5 mins Babji just i want to write code for u with in 5 mins i will send u ok!

but it is useful for you give me full points ok!

Read only

0 Likes
1,368

Hi Babji,

Try This Code.

Parameters: carrid type spfli-carrid,

P_connid(3).

DATA: BEGIN OF values,

carrid type spfli-carrid,

connid type spfli-connid,

END OF values.

data: dinpro_values type table of dynpread,

value_tab like table of values,

field_value like line of dinpro_values.

at selection-screen on value-request for P_connid.

field_value-fieldname = 'CARRID'.

APPEND field_value TO dinpro_values.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = dinpro_values.

READ TABLE dinpro_values INDEX 1 INTO field_value.

values-carrid = FIELD_VALUE-FIELDVALUE.

SELECT CARRID

connid

FROM sflight

INTO TABLE VALUE_TAB

where carrid eq FIELD_VALUE-FIELDVALUE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

dynpprog = SY-REPID

dynpnr = SY-DYNNR

dynprofield = 'P_CONNID'

value_org = 'S'

TABLES

value_tab = value_tab.

  • I wrote this code for u only Plzz Give me full Points*,

Mahi.

Read only

0 Likes
1,368

Thank you. I have given the points please check for the same.

once again thanks

Read only

0 Likes
1,368

Thank u Very Much Babji for Points