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

At Selection screen validation

Former Member
0 Likes
948

Hi Friends,

I just have a reqirement of validation during at selection screen event ,i have to get all the Sales distribution channels for a particular sales organisation.Can you give me the some guidance.

Regards,

Dinesh

8 REPLIES 8
Read only

Former Member
0 Likes
863

Hi,

You can use the select query on the db table.

AT SELECTION-SCREEN ON so_ebeln.

regards,

Brijesh Patel

Read only

0 Likes
863

hi,

it triggers like following

at selection screen output - if required

at selection-screen on <fieldname>

at selection-screen.

regards

sarath

Read only

Former Member
0 Likes
863

HI,

You can use TVKOV table for the combination getting. Please reward points if it helps.

Regards,

Brijesh Patel

Read only

Former Member
0 Likes
863

Hi Dinesh,

Please check the below code to validate:

IF NOT S_BUKRS is initial.

select bukrs into t001-bukrs upto 1 rows from t001

where bukrs in s_bukrs.

end select.

if sy-subrc ne 0.

message e594.

endif.

endif.

clear: t001.

Regards

Kannaiah

Read only

Former Member
0 Likes
863

Sales distribution channels for a particular sales organisation

TVKO -->sales organizations

check the table

TVKOV for distribution channels . " validations

all this are related to sales area .

so in the at selection screen events use the check tables for validations.

regards,

vijay

Read only

Chaitanyat
Participant
0 Likes
863

hi,

since your requirement is to get all distribution channels for a given sales organisation you need to perform validation for the sales organisation you enter. So, you would probably get the input for sales organisation, for this perform validation at selction screen. And then you could select the distribution channels for the same.

Message was edited by:

Chaitanya

Read only

Former Member
0 Likes
863

For validating a selection screen field, u should consider the header table that is a must.

Eg: My selection screen field is marc-matnr.

<b>U have to see whether the matnr in marc is having any check table if so u have to refer the check table not marc.</b>

So to validate this fiedl.

SELECT-OPTIONS: s_matnr LIEK mara-matnr.

AT SELECTION SCREEN ON s_matnr.
 IF NOT s_matnr[] IS INITIAL.
  select matnr from mara
                     into mara-matnr
                     where matnr = s_matnr.
  IF sy-subrc NE 0.
    MESSAGE i128.
    LEAVE LIST-PROCESSING.
  ENDIF.
 ENDIF.

Hope this solves ur query.

Read only

Former Member
0 Likes
863

<b>REPORT zex23 .

TABLES : vbak.

PARAMETERS: p_vkorg TYPE vbak-vkorg.

SELECT-OPTIONS :s_vtweg FOR vbak-vtweg.

DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.

DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

DATA : BEGIN OF xvbak OCCURS 0,

vtweg LIKE TVKOV-vtweg,

END OF xvbak.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vkorg.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'VBAK'

fieldname = 'VKORG'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'P_VKORG'

TABLES

return_tab = return

EXCEPTIONS

field_not_found = 1

no_help_for_field = 2

inconsistent_help = 3

no_values_found = 4

OTHERS = 5.

BREAK-POINT.

REFRESH dynfields.

READ TABLE return WITH KEY fieldname = 'P_VKORG'.

  • Add it back to the dynpro.

dynfields-fieldname = return-retfield.

dynfields-fieldvalue = return-fieldval.

APPEND dynfields.

  • DATA: xvbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE,

DATA : low TYPE vbak-vtweg,

high TYPE vbak-vtweg.

CLEAR xvbak.

SELECT vtweg FROM tvkov

INTO TABLE xvbak

WHERE vkorg = return-fieldval.

SORT xvbak.

READ TABLE xvbak INDEX 1.

low = xvbak-vtweg.

READ TABLE xvbak INDEX sy-dbcnt.

high = xvbak-vtweg.

dynfields-fieldname = 'S_VTWEG-LOW'.

dynfields-fieldvalue = low.

APPEND dynfields.

dynfields-fieldname = 'S_VTWEG-HIGH'.

dynfields-fieldvalue = high.

APPEND dynfields.

  • Update the dynpro values.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = dynfields

EXCEPTIONS

OTHERS = 8.

START-OF-SELECTION.</b>

Press f4 for parameter field sales organisation then u will the get the corresponding range of distribution channel of that sales organisation