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

sk_kamaruzzaman
Participant
0 Likes
569

Hi,

In selection screen - select option s_vkorg default value 'A'.

.Here the sales organization 'A' is always default.

Now the user wants to add sales organization 'B'.

In that condition :-

if user belongs to 'A' then - Default will be 'A' and A related data will be display.

if user belongs to 'B'. then default will be 'B' and B related data will display...

Bye..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
537

Hi sk kamaruzzaman ,

This code will work.

data: fs_vkorg like vbak-vkorg.

select-options : s_vkorg for fs_vkorg.

initialization.

perform get_user.

start-of-selection.

form get_user.

select

vkorg

from vbak

into fs_vkorg

where ernam = sy-uname.

check sy-subrc = 0.

endselect.

move fs_vkorg to s_vkorg-low.

append s_vkorg.

endform.

pls reward points if u found it as helpful.

Thanks and regards,

Rajesh.

5 REPLIES 5
Read only

Former Member
0 Likes
537

Hi,

My advice is

1) you put 2 radio buttons in the selection screen, one for Sales org A and other for Sales org B.

2) Select-options would be only one. when the user press the sales org A, then select options should be filled up with A and if the user press the sales org B, then select options should be filled up with B.

the following EVENTS are used to fulfil the above

1) INITIALIZATION

2) AT SELECTION-SCREEN OUTPUT

3) AT SELECTION-SCREEN

thanks & regards

Kishore Kumar Maram

Read only

Former Member
0 Likes
538

Hi sk kamaruzzaman ,

This code will work.

data: fs_vkorg like vbak-vkorg.

select-options : s_vkorg for fs_vkorg.

initialization.

perform get_user.

start-of-selection.

form get_user.

select

vkorg

from vbak

into fs_vkorg

where ernam = sy-uname.

check sy-subrc = 0.

endselect.

move fs_vkorg to s_vkorg-low.

append s_vkorg.

endform.

pls reward points if u found it as helpful.

Thanks and regards,

Rajesh.

Read only

Former Member
0 Likes
537

Hi,

you can modify the selection-screen.

e.g.

&----


AT SELECTION-SCREEN OUTPUT.

&----


LOOP AT SCREEN.

if screen-GROUP4 => '011'

and screen-group4 < '015'.

screen-REQUIRED = '1'.

modify screen.

endif.

Read only

Former Member
0 Likes
537

Hi,

Check the below logic.

parameters: p_text like p0001-ename default 'A'.

DATA: v_num type i value 1,

val1 like p0001-ename.

data: begin of itab occurs 0,

val like p0001-ename,

name like p0001-ename,

end of itab.

data: begin of itab1 occurs 0,

val like p0001-ename,

name like p0001-ename,

end of itab1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_text.

refresh itab1.

if v_num = 1.

itab-val = 'A'.

itab-name = 'Kumar'.

append itab.

itab-val = 'B'.

itab-name = 'bvsm'.

append itab.

v_num = v_num + 1.

endif.

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_TEXT'.

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_TEXT'.

IF sy-subrc = 0.

val1 = dynpfields-fieldvalue.

ENDIF.

ENDIF.

loop at itab where val = val1.

append itab to itab1.

clear itab1.

endloop.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'VAL'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_TEXT'

value_org = 'S'

TABLES

value_tab = itab1

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.

Read only

sk_kamaruzzaman
Participant
0 Likes
537

solved