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

SELECT STATEMENT

Former Member
0 Likes
896

Dear all,

I am using this select statement

SELECT VBELN

WBSTK

FROM VBUK

INTO TABLE IT_VBUK

WHERE WBSTK EQ P_WBSTK. "" here P_WBSTK = 'C'.

SORT IT_VBUK BY VBELN. "" here data is coming perfect

IF IT_VBUK IS NOT INITIAL.

SELECT VBELN

PARVW

KUNNR

FROM VBPA

INTO TABLE IT_VBPA

FOR ALL ENTRIES IN IT_VBUK

WHERE VBELN = IT_VBUK-VBELN

AND PARVW EQ 'SH'. "" IF I hide this line then data is came.. but in my DAE system have data for PARVW EQ 'SH' .

Please help me..

Regards

margani

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

Hi,

Which partner type are you looking for? If it's the Ship-To partner then you need = 'WE' NOT = 'SH' because the domain for partner type has a conversion exit (drill down in data dictionary to the domain to see it!).

What this means is although you may input a value of SH for Ship-To and you see SH displayed in reports and in dialog screens, internally (and in the database) this gets converted to WE for processing and DB matching (I think table TPAR shows this also).

Regards, Andy

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
847

Try this code.


SELECT VBELN
WBSTK
FROM VBUK
INTO TABLE IT_VBUK
WHERE WBSTK EQ P_WBSTK. "" here P_WBSTK = 'C'.

SORT IT_VBUK BY VBELN. "" here data is coming perfect
IF IT_VBUK IS NOT INITIAL.
SELECT VBELN
PARVW
KUNNR
FROM VBPA
INTO TABLE IT_VBPA
FOR ALL ENTRIES IN IT_VBUK
WHERE VBELN = IT_VBUK-VBELN
AND PARVW =  'SH' .         -------------------> change here EQ to =.

Read only

Former Member
0 Likes
847

HI Gautham Vangaveti ,

I tried for that one. but it is not working..

Regards

margani

Read only

Former Member
0 Likes
848

Hi,

Which partner type are you looking for? If it's the Ship-To partner then you need = 'WE' NOT = 'SH' because the domain for partner type has a conversion exit (drill down in data dictionary to the domain to see it!).

What this means is although you may input a value of SH for Ship-To and you see SH displayed in reports and in dialog screens, internally (and in the database) this gets converted to WE for processing and DB matching (I think table TPAR shows this also).

Regards, Andy

Read only

0 Likes
847

HI abapandy ,

THANKS FOR GIVING VALUBLE ANSWER.

Rergards

margani

Read only

Former Member
0 Likes
847

Hi,

Field PARVW has a conversion exit. Check with internal number. Also, While using for all entries use all primary keys. In this case select vbeln posnr parvw kunnr from VBPA.

Hope it helps.

Sujay

Read only

Clemenss
Active Contributor
0 Likes
847

Hi Margani,

just a hint regarding readability and code stability:

SELECT VBELN
WBSTK
FROM VBUK
INTO TABLE IT_VBUK

This code works only if the structure of TABLE IT_VBUK has exactly the fields VBELN

and WBSTK. Who ever reads the code may assume that IT_VBUK has the structure of DB table VBUK. Abetter name would be i.e. like IT_VBELN_WBSTK.

If you do not SELECT * INTO table it is always better to SELECT ... INTO CORRESPONDING FIELDS OF table. This is resolved once and will not cost any performance. But you will never face any problems .

Regards,

Clemens

P.S. Pleas post code as code!