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

To Write a Query

Former Member
0 Likes
698

Hello All,

I have a requirement to write a query for the below case:

The query should pick up all the ZD2D item category lines (VBAP-PSTYV=ZD2D) , where either of the below cases are fulfilled.

1.For the combination of VBAP_VBELN and VBAP-POSNR, where VBAP-PSTVY = ZD2D, Please check if VBFA-VBTYP_N = blank, then display the output.

2.If VBFA-VBTYP_N = M , then check for VBUP-GBSTA not equal to C.

If either of the above conditions are fulfilled, the lines should be shown in the report.

My question is , can we use a single query to give two different outputs for the above two cases. I was thinkin of using two different variants. Can this be done in any other way?

Thanks,

Rachana.

3 REPLIES 3
Read only

Former Member
0 Likes
648

Hi,

i hope this will help you

IF vbfa-vbtyp_n = 'M'.

SELECT * FROM <table>

WHERE vbup-gbsta <> 'C'.

ELSEIF vbfa-vbtyp_n IS INITIAL.

SELECT * FROM <table>

WHERE vbap-vbeln = 'Value'

AND vbap-posnr = 'Value'

AND vbap-pstvy = 'ZD2D'.

ENDIF.

Read only

Clemenss
Active Contributor
0 Likes
648

Hi,

this looks like a programming request. This is no ABAP objects question.

Send me some cash and I will think about your request, thanks you.

Regards,

Clemens

Read only

ThomasZloch
Active Contributor
0 Likes
648

vague subject, wrong forum, likely case of "spec dumping", thread locked.

Thomas