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 For WRBTR

Former Member
0 Likes
910

Hi,

In Amount field (ITAB-WRBTR)

In the File Amount field (ITAB-WRBTR) format like this <b>5,500.00</b> it will goes to Error table

OR

In the File Amount field (ITAB-WRBTR) Format like this<b> 5500</b> it will goes to SAP (BDC - SESSION)

In the File Amount field (ITAB-WRBTR) format like this <b>5.500,00</b> it will goes to SAP (BDC - SESSION)

I want validate this Amount Field

please send the sample code for this

I look forward to your reply

Thanks & Regards

SEK

Hi,

In Amount field (ITAB-WRBTR)

In the File Amount field (ITAB-WRBTR) format like this <b>5,500.00</b> it will goes to Error table

OR

In the File Amount field (ITAB-WRBTR) Format like this<b> 5500</b> it will goes to SAP (BDC - SESSION)

In the File Amount field (ITAB-WRBTR) format like this <b>5.500,00</b> it will goes to SAP (BDC - SESSION)

I want validate this Amount Field

please send the sample code for this

I look forward to your reply

Thanks & Regards

SEK

5 REPLIES 5
Read only

Former Member
0 Likes
803

Hi Raja Sekhar,

Check your previous thread

Regards,

Raghav

Read only

Former Member
0 Likes
803

Find the field length.

subtract two from the length and

Check like this

wrbtr_temp+0(L) = ',' "L = subtracted length

then do the process required.

give error message or replace it with '.'

By

Yuvaram

Read only

andreas_mann3
Active Contributor
0 Likes
803

Hi,

you must use:

1) char-field for bdc

2) dec-field for validation in your program

A.

Read only

Former Member
0 Likes
803

Dear Raja,

Always remember this thumb rule while carrying out BDC Programming.

In your case, lets consider the field WRBTR. You want to use field in your BDC Programming.

Goto SE11 --> Enter the Table where the field WRBTR lies --> Search for the field

WRBTR ---> Goto the Data Element of the field ... for example its the same as the field name i.e. WRBTR ---> Double Click on it -


> Goto the Domain : WERT7 --->

You'll find the Output length to be 16.

So, always declare the field WRBTR in your TYPES Structure as CHAR(16).

Regards,

Abir

***********************************

  • Don't forget to award Points *

Read only

Former Member
0 Likes
803

Hi Raja,

use an CHAR-Field and try this:

DATA: WRBTR(12).

*

DATA: FDPOS_K LIKE SY-FDPOS.

DATA: FDPOS_P LIKE SY-FDPOS.

WRBTR = '5.000,00'.

*

SEARCH WRBTR FOR ','.

IF SY-SUBRC = 0. FDPOS_K = SY-FDPOS. ENDIF.

*

SEARCH WRBTR FOR '...'.

IF SY-SUBRC = 0. FDPOS_P = SY-FDPOS. ENDIF.

*

IF FDPOS_P > FDPOS_K.

WRITE: / FDPOS_P, FDPOS_K, 'ERROR'.

ELSE.

WRITE: / FDPOS_P, FDPOS_K, 'WITHOUT ERROR'.

ENDIF.

*

Regards, Dieter