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

VALIDATION

Former Member
0 Likes
668

I want to validate the field VKORG from VBRK table. Check table is TVKO.

Let me know the systax of validation.

its urgent

5 REPLIES 5
Read only

varma_narayana
Active Contributor
0 Likes
608

Hi..

Tables tvko.

PARAMETERS : P_VKORG TYPE VBRK-VKORG.

AT SELECTION-SCREEN.

SELECT SINGLE * FROM TVKO

WHERE VKORG = P_VKORG.

IF sy-subrc ne 0.

Message E001(Zcl) .

Endif.

<b>Reward if Helpful</b>

Read only

former_member404244
Active Contributor
0 Likes
608

Hi,

PARAMETERS : P_VKORG like VBRK-VKORG.

AT SELECTION-SCREEN.

SELECT SINGLE * FROM vbrk

WHERE VKORG = P_VKORG.

IF sy-subrc ne 0.

throw error message or information message

Endif.

Regards,

Nagaraj

Read only

Former Member
0 Likes
608

Hello,

I think this code will help u

  • Validate Customer No.

<b>AT SELECTION-SCREEN ON p_vkorg</b>.

SELECT SINGLE * FROM tvko WHERE vkorg = p_vkorg.

IF sy-subrc <> 0.

MESSAGE e041 WITH 'Enter valid Sales Organization.'.

ENDIF.

Reward points for good answers.

Regards,

Lijo John

Read only

Former Member
0 Likes
608

Hi

select-option : s_vkorg for tvko-vkorg.

at selection-screen.

select single vkorg from vbrk where vkorg in s_vkorg.

if sy-subrc ne 0.

error.

endif.

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
608

THERE ARE 2 WAYS

1)

PARAMETERS : VKORG LIKE VBAK-VKORG VALUE CHECK

WHEN ENTER SOME VALUES IN THE SELECTION SCREEN AND PRESS ENTER IF THAT VALUE IS NOT THERE IN THAT TABLE THEN THAT WILL DISPLAY SOME ERROR

2)

BY USEING LIKE THIS , WRITE A SELECT QUERY WHAT VALUES U WANT AND CALL THIS FUNCTION MODULW THEN IT WILL RETRIVE ONLY RELATED DATA

SELECT OTYPE OBJID FROM HRP1000

INTO TABLE IT_OBJID_SH

WHERE OTYPE = 'D'.

IF SY-SUBRC EQ 0.

  • SEARCH HELP FOR QUALIFICATION.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'OBJID'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_OBJID'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_OBJID_SH

  • FIELD_TAB =

  • RETURN_TAB = RETURN_TAB

  • DYNPFLD_MAPPING =

  • 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.

ENDIF.