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

Trouble validating in field-exit

Former Member
0 Likes
401

I'm using field symbols to enter the values I need to validate in transaction FBCJ, th reference field.

For some reason all the validations I try with '(SAPMFCJ0)itcj_e_postings-tax_code' are not working. It treats them as if the were

I can't find a way to place a break-point in the exits, but when I pass that field symbols to the output export, the Reference field gets filled with the transaction, so I suppose the validations should work

Here is the troubling code


data: i_nd(2) value 'ND',
      i_na(2) value 'NA',
      i_value(2).

DATA: l_tex1(25) value '(SAPMFCJ0)iscj_e_postings',
      l_tex2(18) value '(SAPMFCJ0)sy-ucomm',
      l_tex3(35) value '(SAPMFCJ0)itcj_e_postings-tax_code',
      l_x(3).

FIELD-SYMBOLS: <fest> TYPE iscj_postings,
               <fokc> TYPE sy-ucomm,
               <fes2> TYPE iscj_postings-tax_code.
ASSIGN (l_tex2) to <fokc>.
if sy-subrc EQ 0.
l_x = 'X'.
endif.
ASSIGN (l_tex1) to <fest>.
if sy-subrc EQ 0.
l_x+1 = 'X'.
endif.
ASSIGN (l_tex3) to <fes2>.
if sy-subrc EQ 0.
l_x+2 = 'X'.
endif.


move <fes2> to i_value.

if NOT <fest>-transact_name IS INITIAL AND i_value NE i_nd AND i_value
NE i_na.
CALL METHOD checa_rfcok
EXPORTING
i_est = <fest>.
endif.

I'm using field symbols to enter the values I need to validate in transaction FBCJ, th reference field.

For some reason all the validations I try with '(SAPMFCJ0)itcj_e_postings-tax_code' are not working. It treats them as if the were

I can't find a way to place a break-point in the exits, but when I pass that field symbols to the output export, the Reference field gets filled with the transaction, so I suppose the validations should work

Here is the troubling code


data: i_nd(2) value 'ND',
      i_na(2) value 'NA',
      i_value(2).

DATA: l_tex1(25) value '(SAPMFCJ0)iscj_e_postings',
      l_tex2(18) value '(SAPMFCJ0)sy-ucomm',
      l_tex3(35) value '(SAPMFCJ0)itcj_e_postings-tax_code',
      l_x(3).

FIELD-SYMBOLS: <fest> TYPE iscj_postings,
               <fokc> TYPE sy-ucomm,
               <fes2> TYPE iscj_postings-tax_code.
ASSIGN (l_tex2) to <fokc>.
if sy-subrc EQ 0.
l_x = 'X'.
endif.
ASSIGN (l_tex1) to <fest>.
if sy-subrc EQ 0.
l_x+1 = 'X'.
endif.
ASSIGN (l_tex3) to <fes2>.
if sy-subrc EQ 0.
l_x+2 = 'X'.
endif.


move <fes2> to i_value.

if NOT <fest>-transact_name IS INITIAL AND i_value NE i_nd AND i_value
NE i_na.
CALL METHOD checa_rfcok
EXPORTING
i_est = <fest>.
endif.

1 REPLY 1
Read only

Former Member
0 Likes
355

It appears that the field exit enters several times, that's why the output did show the tax code

Solved this using all the conditions in structure (SAPMFCJ0)itcj_e_postings because it has all the values I need to validate