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

logic for query

Former Member
0 Likes
364

Hi I need logic for this please help me,

If Check box is selected.

Get BUKRS, check from Table VBRK using W_VRKPA-VBELN.

Read data from Table BSID. Match W_VRKPA-KUNDE to BSID-KUNNR, BUKRS to BSID-BUKRS, W_VRKPA-VBELN to BSID-XBLNR.

If data is available from BSID, continue with further logic, else continue with the loop. No need to store the data from BSID.

Thanks & Regards

2 REPLIES 2
Read only

Former Member
0 Likes
338

Hi,

Check this..

IF P_CHECK = 'X'.

SELECT SINGLE BUKRS FROM VBRK

INTO LV_BUKRS

WHERE VBELN = W_VRKPA-VBELN.

IF SY-SUBRC = 0.

SELECT SINGLE * FROM BSID

WHERE KUNNR = W_VRKPA-KUNDE

AND BUKRS = LV_BUKRS

AND XBLNR = W_VRKPA-VBELN.

IF SY-SUBRC = 0.

............CONTINUE PROCESSING.........

ELSE.

.....

ENDIF.

ENDIF.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
338

Hi,

use this logic,

if checkbox-name eq 'X'.

loop at it_vbkpa into w_vbkpa.

select single bukrs from vbrk into table it_bukrs where vbeln = w_vbkpa-vbeln.

if sy-subrc = 0.

read table it_bsid with key KUNNR = W_VRKPA-KUNDE BSID-BUKRS = BUKRS XBLNR = W_VRKPA-VBELN.

if sy-subrc <> 0.

continue.

else.

.............

endif.

endif.

endloop.

endif.

hope this wud work.

Thanks,

Prashanth