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 to do Process on Value?

Former Member
0 Likes
1,091

Hi,

I have 2 inputfield, Name and contact number.

Name have a search help.

Contact number also have a search help but is determine by the name being choose.

How to do it? Any step by step guide? I don't understand when given a chunk of code.

Regards,

Rayden

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,063

hi

use the at selection screen on value request

give the field name

at selection screen on value request

select contactno

from ztable

into wa_itab-contactno

where name = p_name.....

use this coding it may help u

if u click f4 name and contact no will come

9 REPLIES 9
Read only

Former Member
0 Likes
1,064

hi

use the at selection screen on value request

give the field name

at selection screen on value request

select contactno

from ztable

into wa_itab-contactno

where name = p_name.....

use this coding it may help u

if u click f4 name and contact no will come

Read only

Former Member
0 Likes
1,063

hi Rayden,

Check out this program in SAP DEMO_DYNPRO_F4_HELP_MODULE. hope this will meet ur requirement.

regards,

Santosh Thorat

Read only

0 Likes
1,063

Hi Santosh Thorat ,

I try that.. but having error generate my screen 9000. By the way, i not using selection screen. i using dialog screen for my ABAP Program. how to do that in dialog screen?

Regards,

Rayden

Read only

Former Member
0 Likes
1,063

Hi Rayden,

Can you give me the table name which contains the fields that you are talking about ( Name & Contact number ) So that i can write the code and send.

Check the below code.

tables: t001k.

  • For Identification Number

DATA: BEGIN OF it_bwkey OCCURS 0,

bwkey LIKE t001k-bwkey,

END OF it_bwkey.

data: v_bukrs(4).

  • For Run date

DATA: BEGIN OF it_bukrs OCCURS 0,

bukrs LIKE t001k-bukrs,

END OF it_bukrs.

DATA it_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE.

SELECTION-SCREEN: BEGIN OF BLOCK main WITH FRAME TITLE text-001.

SELECTION-SCREEN SKIP.

PARAMETERS: p_bukrs(4) TYPE c.

SELECT-OPTIONS s_bwkey FOR t001k-bwkey NO INTERVALS.

SELECTION-SCREEN END OF BLOCK main.

*----


  • Validation Section

*----


INITIALIZATION.

SELECT DISTINCT bukrs FROM t001k INTO TABLE it_bukrs.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

value_org = 'S'

TABLES

value_tab = it_bukrs

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bwkey-low.

TABLES: t130r.

DATA: BEGIN OF dynpfields OCCURS 0. "Hilfsstruktur zum auslesen des

INCLUDE STRUCTURE dynpread. "Feldwertes vom Dynpro bei >F4<

DATA: END OF dynpfields.

DATA : sy_repid LIKE sy-repid,

sy_dynnr LIKE sy-dynnr.

CLEAR dynpfields.

REFRESH dynpfields.

dynpfields-fieldname = 'P_BUKRS'.

APPEND dynpfields.

    • Lesen des akt. Wertes von Dynpro

sy_repid = sy-repid.

sy_dynnr = sy-dynnr.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy_repid

dynumb = sy_dynnr

TABLES

dynpfields = dynpfields

EXCEPTIONS

OTHERS = 01.

IF sy-subrc = 0.

READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.

IF sy-subrc = 0.

v_bukrs = dynpfields-fieldvalue.

ENDIF.

ENDIF.

SELECT bwkey FROM t001k

INTO TABLE it_bwkey

WHERE bukrs = v_bukrs.

DELETE ADJACENT DUPLICATES FROM it_bwkey.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BWKEY'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_BWKEY'

value_org = 'S'

TABLES

value_tab = it_bwkey

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Message was edited by:

Velangini Showry Maria Kumar Bandanadham

Read only

0 Likes
1,063

Hi Velangini Showry Maria Kumar Bandanadham,

My Table is ZSTUD00. I doing on dialog scrren and not selection screen. Both my Name and contact field is "Get From Dictionary" using Graphical Screen Painter. So do i go about it? Is there anyway that i can do with less coding?

Regards,

Rayden

Read only

0 Likes
1,063

Hi Rayden,

Eventhough it is dialog program you have to use the same logic which i gave.

Instead of parameter you can give the screen-field. Try replace my code with your table and fields.

Read only

0 Likes
1,063

Hi Rayden,

Replace 'INPUT FIELD for NAME' and 'INPUT FIELD for NUMBAR' with your screen fields.

And make sure that your table fields are correct as i took name for name and number for number. you can replace the fields with exact names from the table

ZSTUD00.

Check the below code

*Flow logic

PROCESS ON VALUE-REQUEST.

FIELD 'INPUT FIELD for NAME' MODULE get_valid_name.

FIELD 'INPUT FIELD for NUMBAR' MODULE get_valid_number.

*main program

  • internal tables

data: begin of it_name occurs 0,

name like ZSTUD00-name,

end of it_name.

data: begin of it_number occurs 0,

name like ZSTUD00-number,

end of it_number.

TABLES: t130r.

DATA: BEGIN OF dynpfields OCCURS 0.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynpfields.

***********************************************

module get_valid_name input.

***********************************************

Select name from ZSTUD00 into table it_name.

if not it_name[] is initial.

sort it_name by name.

endif.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'NAME'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'INPUT FIELD FOR NAME'

VALUE_ORG = 'S'

tables

value_tab = it_name

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE.

***********************************************

module get_valid_number input.

***********************************************

CLEAR : dynpfields.

REFRESH: dynpfields.

dynpfields-fieldname = 'INPUT FIELD FOR NAME'.

APPEND dynpfields.

clear dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = dynpfields.

IF sy-subrc = 0.

READ TABLE dynpfields INDEX 1.

IF sy-subrc = 0.

'INPUT FIELD FOR NAME' = dynpfields-fieldvalue.

ENDIF.

ENDIF.

Select number from ZSTUD00 into table it_number where name = 'INPUT FIELD FOR NAME'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'NUMBER'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'INPUT FIELD FOR NUMBER'

VALUE_ORG = 'S'

tables

value_tab = it_number

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE.

Hope this will solve your problem.

Read only

Former Member
0 Likes
1,063

hi

good

You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.

...

FIELD <f> MODULE <mod>.

...

After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm

thanks

mrutyun^

Read only

Former Member
0 Likes
1,063

Hi

REPORT ZV_MODULE .

TABLES: MAKT.

CALL SCREEN 100.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

IF NOT MAKT-MATNR IS INITIAL.

SELECT SINGLE MAKTX FROM MAKT INTO MAKT-MAKTX WHERE MATNR = MAKT-MATNR

AND SPRAS = SY-LANGU .

ENDIF.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

IF NOT MAKT-MATNR IS INITIAL.

SELECT SINGLE MAKTX FROM MAKT INTO MAKT-MAKTX WHERE MATNR = MAKT-MATNR

AND SPRAS = SY-LANGU .

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

reward if usefull