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

partner function AG (Sold-to-party) - read the partner code

Former Member
0 Likes
10,918

Hi All!

I tried to write an ABAP code to get the alphanumeric key, which clearly identifies the partner with partner function AG (Sold-to-party) and RE (Bill-to-party) for the Outbound delivery. I want to compare this two values and output an message if the value is not the same. My problem is that for the partner function AG it is not read the wright value (the value that the system reads is 0).

The ABAP code is:

-


DATA: ag_ec , re_df TYPE KUNNR .

CLEAR: ag_ec , re_df .

READ TABLE xvbpa WITH KEY parvw = <b>'AG'</b>.

IF sy-subrc = 0 .

<b>ag_ec</b> = xvbpa-kunnr . ENDIF.

READ TABLE xvbpa WITH KEY parvw = 'RE'.

IF sy-subrc = 0 .

re_df = xvbpa-kunnr . ENDIF.

IF NOT re_df EQ ag_ec .

MESSAGE E006(ZFC).

ENDIF.

-


Could anybody help me to find a solution?

Your time and response will be appreciated.

Florina C.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,411

before going to ur query

it seems there is a declaration problem .

<b>DATA: ag_ec is type 1 character .</b>

<b>DATA: ag_ec type kunnr , re_df TYPE KUNNR .</b>

and now check the value.

DATA: ag_ec , re_df TYPE KUNNR . " this is probelm
CLEAR: ag_ec , re_df .
READ TABLE xvbpa WITH KEY parvw = 'AG'.
IF sy-subrc = 0 .
ag_ec = xvbpa-kunnr . ENDIF.

ag_ec = xvbpa-kunnr . ENDIF.

with the declaration there will be only once character in ag_ec and probably it is picking 0 of that ccustomer value.

regards,

vijay

3 REPLIES 3
Read only

Former Member
0 Likes
5,412

before going to ur query

it seems there is a declaration problem .

<b>DATA: ag_ec is type 1 character .</b>

<b>DATA: ag_ec type kunnr , re_df TYPE KUNNR .</b>

and now check the value.

DATA: ag_ec , re_df TYPE KUNNR . " this is probelm
CLEAR: ag_ec , re_df .
READ TABLE xvbpa WITH KEY parvw = 'AG'.
IF sy-subrc = 0 .
ag_ec = xvbpa-kunnr . ENDIF.

ag_ec = xvbpa-kunnr . ENDIF.

with the declaration there will be only once character in ag_ec and probably it is picking 0 of that ccustomer value.

regards,

vijay

Read only

0 Likes
5,411

You are right. It solved my problem.

Thank you very much.

Best regards,

Florina C.

Read only

0 Likes
5,411

You are welcome .

cheers

regards,

vijay.