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: 

At selection screen

Former Member
0 Kudos

Hi Friends,

I want to check the entries for Sales organisation in the selection screen p_vkorg (parameters)<b>vbak-vkorg.</b>

Can you pls tell me how to do it.

Thanx in advance

Venu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello VENU,

Use this code.

<b>AT SELECTION-SCREEN ON P_VKORG.

SELECT SINGLE * FROM TVKO where VKORG = P_VKORG.

IF SY-SUBRC NE 0.

Message E000(SU) with the 'The Sales Org is not found'.

endif.</b>

If useful reward.

Vasanth

8 REPLIES 8

Former Member
0 Kudos

What exactly the requirement is? Do you want to just read the values or you also want to check whether those are present in the master data table?

To read the value from selection screen you can use FM DYNP_VALUES_READ.

Best Regards,

Vibha

*Please mark all the helpful answers

0 Kudos

Hi,

I also want to check whether the values present in the database table.

Thanx,

Venu

Former Member
0 Kudos
AT SELECTION-SCREEN.

  IF NOT P_VKORG IS INITIAL.
     SELECT SINGLE VKORG FROM TVKO INTO VBAK-VKORG WHERE VKORG = P_VKORG.
  IF SY-SUBRC NE 0.
        *DISPLAY ERROR MESSAGE HER
  ENDIF.
ENDIF.

Reward points if ur problem solved , for the previous thread also

Former Member
0 Kudos

hi Venu,

Do this way ..

at selection-screen.

select * from vbak where vkorg = p_vkorg.

if sy-subrc = 0.

< do something>
endif.

Regards,

santosh

Former Member
0 Kudos

Hello VENU,

Use this code.

<b>AT SELECTION-SCREEN ON P_VKORG.

SELECT SINGLE * FROM TVKO where VKORG = P_VKORG.

IF SY-SUBRC NE 0.

Message E000(SU) with the 'The Sales Org is not found'.

endif.</b>

If useful reward.

Vasanth

Manohar2u
Active Contributor
0 Kudos

REPORT YTEST_100 .

tables vbak.

parameter p_vkorg like vbak-vkorg.

at selection-screen.

select single * from vbak into vbak where vkorg = p_vkorg.

if sy-subrc ne 0.

message s000(eo) with 'No data found'.

exit.

endif.

start-of-selection.

Regds

Manohar

Former Member
0 Kudos

Hi Venu,

I think you want to get the possible values for the sale Organization at the selection screen.

try: PARAMETERS : p_org type VKORG.

this will return only those values which are available in DB.

Hope this helps.

Reward points if this helps.

Manish

Message was edited by: Manish Kumar

shishupalreddy
Active Contributor
0 Kudos

hI ,

Use the following code hope it will help you to resolve u r issue.

data : r_vkorg LIKE vbak-vkorg.

AT SELECTION-SCREEN.

IF NOT p_vkorg IS INITIAL.

select single vkorg from vbak INTO r_vkorg WHERE VKORG = p_vkorg.

IF SY-SUBRC <> 0.

MESSAGE 'nodata' TYPE 'E'.

endif.

regards,