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

Field validations

Former Member
0 Likes
701

Hi all,

I am getting confused that how to validate the Sales Order fields data which are stored in flat file from client side and equal to sap table data.

how to compare and validate the fields & data.

i am new to this.

anyone can u Please send me coding.

Thanks in advance

Venkat

5 REPLIES 5
Read only

Former Member
0 Likes
549

Upload that file into SAP with FM 'GUI_UPLOAD' (to internal table) Than compare that internal table with sap table.

BR, JAcek

Read only

Former Member
0 Likes
549

Hello Venkat,

Upload the Flat file data to an internal table Itab.

LOOP AT ITAB.

select single * from vbak where vbeln = itab-vbeln.

if sy-subrc NE 0.

ERROR MESSAGE.

ENDIF.

ENDLOOP.

Reward if helps.

Vasanth

Read only

Former Member
0 Likes
549

Hi Venkat -

1. Map the flay file fields to SAP fields.

2. Find the check table for the SAP fields (for sales order u can check with VBAK table....there check the data elemnts of fields and check tables.....u will know which table to use for validation)

3. Once u find the check table, pass the field value n check if the value is present in the table (select up2 1 rows or sleect single).

-Aarthi.

Read only

Former Member
0 Likes
549

hi Venkat,

first using GUI_UPLOAD store the data in internal table

then loop at internal table and validate each field against the check table of that field

loop at itab.

    select single field from checktable where field = itab-field.
      if sy-subrc eq 0.
          field correct.
      endif.
  endloop.

Read only

Former Member
0 Likes
549

Upload that file into SAP with 'GUI_UPLOAD' (to internal table).

Find the check table for the SAP fields (for sales order u can check with VBAK table....there check the data elemnts of fields and check tables.....u will know which table to use for validation).

Than compare that internal table with sap table.

Example:

loop at itab.

select single field from checktable where field = itab-field.

if sy-subrc eq 0.

Message i000(su) with ' information exist in the checktable '.

else.

Message e000(su) with ' information no exist in the checktable '.

endif.

endloop.