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

Vendor creation validation

Former Member
0 Likes
1,128

Hi all,

I have to validate as explained below:

I have the input fields as:

INPUT FIELDS -TO BE CHECKED IN Table: LFA1

NAME1 - NAME1

NAME2 - NAME2

NAME3 - NAME3

NAME4 - NAME4

The above written fields need to be checked in LFA1 table.

Get the list of all vendors having same fields (one to one mapping i.e. name1=name1 in LFA1 table).

For the above listed vendors from LFA1 table, address check needs to be done.

Address Check(Excluding special fields)

Field:

1. STRAS

City Check

Field:

1. ORT01

Error should be given if input fields like STRAS, ORT01 are also same in LFA1 database.

How to proceed for this? Is there any FM for checking the database fields?

Any inputs are appreciated.

Thanks & Regards,

Raj.

4 REPLIES 4
Read only

Former Member
0 Likes
927

Rajkaml,

the simple process is that :

i assume you have all name and address in your internal table.then you need to fetch data from LFA1 with matching of internal table than if no data found means sy-subrc = 0 than do whatever you want.

Amit.

Read only

Former Member
0 Likes
927

Hi,

select * from lfa1 into table itab1 where

name1 = name1 and name2 = name 2.....

if sy-subrc = 0.

loop at itab1

if itab1 -stras = itab1-ort01

message ....

endif.

endloop.

else.

stop or exit.

endif.

Thanks & Regards,

Chandralekha.

Read only

Former Member
0 Likes
927

hi raj,

i can suggest you to write the following code, rather than using function module.

USE Event

AT SELECTION-SCREEN.

select *

from lfa1

intot table i_lfa1

where name1 = name1 ( Selection screen fields )

AND name2 = name2

AND name3 = name3

AND name4 = name4.

if sy-subrc is initial.

Proceed and display the ouput.

endif.

The same code you can write for other fields also,

I hope this will solve your problem,

Reward if it is usefull,

Regards,

KP

Edited by: krishna prasad on Jul 29, 2008 7:11 AM

Read only

Former Member
0 Likes
927

Hi RajKamal.

I would like to suggest a few function modules,

/SPE/CHECK_REQ_FIELDS - Check Required Fields

CY_CHECK_SELECTION_FIELD - Checks whether the specified field of a table is a selection field

Hope that's usefull.

Good Luck & Regards.

Harsh Dave