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

Selection-Screen

Former Member
0 Likes
429

Hi ,

I have two fields on selection screen .

Custno and Sales Order No.

My Problem is

When Custmer chooses one value from F4 help in th customer no field.

according that value , in the secod field we have to display his sales orders ?

How can we do it ?

Bye,

Muttu.

3 REPLIES 3
Read only

Former Member
0 Likes
385

Hi..,

<b>just execute this program.. analyse and code it according to your requirement !! this is of same requirement !!</b>

tables:mara,makt,mseg.

parameters: p_bukrs type t001-bukrs,

p_butxt type t001-butxt,

p_ort01 type t001-ort01,

p_land1 type t001-land1.

data: dynfields type table of dynpread with header line.

data: return type table of ddshretval with header line.

at selection-screen on value-request for p_bukrs.

call function 'F4IF_FIELD_VALUE_REQUEST'

exporting

tabname = 'T001'

fieldname = 'BUKRS'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_BUKRS'

tables

return_tab = return

exceptions

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

others = 5.

refresh dynfields.

read table return with key fieldname = 'P_BUKRS'.

  • Add it back to the dynpro.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

append dynfields.

  • Get the company code from db and add to dynpro

data: xt001 type t001.

clear xt001.

select single * into xt001

from t001

where bukrs = return-fieldval.

dynfields-fieldname = 'P_BUTXT'.

dynfields-fieldvalue = xt001-butxt.

append dynfields.

dynfields-fieldname = 'P_ORT01'.

dynfields-fieldvalue = xt001-ort01.

append dynfields.

dynfields-fieldname = 'P_LAND1'.

dynfields-fieldvalue = xt001-land1.

append dynfields.

  • Update the dynpro values.

call function 'DYNP_VALUES_UPDATE'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

tables

dynpfields = dynfields

exceptions

others = 8.

<b>

reward all helpful answers,

sai ramesh</b>

Read only

Former Member
0 Likes
385

jus refer the below program

DATA: p_field_name TYPE help_info-dynprofld.

  • varaible used to get the value returned by the function module

DATA l_return TYPE ddshretval OCCURS 0 WITH HEADER LINE.

  • get the fieldname for F4 help

p_field_name = p_field.

g_repid = sy-repid.

g_dynnr = sy-dynnr.

  • Call the function module for the display of F4 values

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'LGART'

dynpprog = g_repid

dynpnr = g_dynnr

dynprofield = p_field_name

window_title = 'Customer Wage Types'

value_org = 'S'

TABLES

value_tab = g_t_user_help

return_tab = l_return

  • FIELD_TAB =

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3

.

IF sy-subrc = 0.

p_lgart = l_return-fieldval.

ENDIF.

  • Get the text of the wage type that is selected for P_WAGETYPE

SELECT SINGLE lgtxt

FROM t512t

INTO p_lgtxt

WHERE lgart = p_lgart

AND sprsl = sy-langu

AND molga = g_molga.

  • Refresh and clear the table to get the new values

CLEAR g_t_dynfields.

REFRESH g_t_dynfields.

*Populate the internal table with teh Field name(P_LGTXT)

  • and Field Value

g_t_dynfields-fieldname = 'P_LGTXT'.

g_t_dynfields-fieldvalue = p_lgtxt.

APPEND g_t_dynfields.

*Call the Function module to update

*the selection-screen with the wage type description

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = 'ZPHU_PAYUPLD'

dynumb = '1000'

TABLES

dynpfields = g_t_dynfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

IF sy-subrc <> 0.

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

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

ENDIF.

Read only

sonu_p2
Active Participant
0 Likes
385

Hello Satyanarayana,

Check out the following code, hope it will help

REPORT ZSRI_SEARCHHELP .

TYPES: BEGIN OF values,

bukrs TYPE bkpf-bukrs,

belnr TYPE bkpf-belnr,

  • gjahr TYPE bkpf-gjahr,

END OF values.

*

DATA: BUKRS(4) TYPE c,

BELNR(10) TYPE c.

*

DATA: progname TYPE sy-repid,

dynnum TYPE sy-dynnr,

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values,

values_tab TYPE TABLE OF values.

*

CALL SCREEN 100.

*&----


*

*& Module INIT OUTPUT

*&----


*

  • text

*----


*

MODULE INIT OUTPUT.

progname = sy-repid.

dynnum = sy-dynnr.

CLEAR: field_value, dynpro_values.

field_value-fieldname = 'BUKRS'.

APPEND field_value TO dynpro_values.

ENDMODULE. " INIT OUTPUT

*&----


*

*& Module CANCEL INPUT

*&----


*

  • text

*----


*

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

  • " CANCEL INPUT

***&----


*-

***

*& Module VALUE_BUKRS INPUT

*&----


*

  • text

*----


*

MODULE VALUE_BUKRS INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'BKPF'

fieldname = 'BUKRS'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'BUKRS'.

ENDMODULE. " VALUE_BUKRS INPUT

**&----


**

**& Module VALUE_BELNR INPUT

**&----


**

    • text

**----


**

MODULE VALUE_BELNR 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.

SELECT BUKRS BELNR

FROM BKPF

INTO CORRESPONDING FIELDS OF TABLE values_tab

WHERE BUKRS = field_value-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'BELNR'

value_org = 'S'

TABLES

value_tab = values_tab.

ENDMODULE. " VALUE_BELNR INPUT

*

&----


*& Module VALUE_GJAHR INPUT

&----


  • text

----


MODULE VALUE_GJAHR INPUT.

ENDMODULE. " VALUE_GJAHR INPUT

Screen painter flow logic se51

PROCESS BEFORE OUTPUT.

MODULE INIT.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD BUKRS MODULE VALUE_BUKRS.

FIELD BELNR MODULE VALUE_BELNR.

  • FIELD GJAHR MODULE VALUE_GJAHR.

*

Thanks ,

Sachin