Application Development 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: 

problem in query

Former Member
0 Kudos
103

DEAR FRIENDS,

I HAVE TO GET DATA FROM BSEG TABLE ACCRODING FOLLOWING SELECTION DATA IN WHERE CONDITION MENTIONED IN BELOW QUERIES.

I HAVE DATA IN TEMP_VBRK BUT AFTER EXCUTING FOLLOWING QUEREY I AM GETTING ITAB_BSEG INITIAL. NO DATA.

WHILE SAME SELECTION DATA PUTTING IN SE16-BSEG,THEN I AM GETTING REQUIRED DATA.

I HAD TRY SOME DIFFERENT WAY ALSO BUT STILL GET NO DATA.

PLEASE SUGGEST POSSIBLE WAY OF SOLUTIONS.

**********************************

LOOP AT TEMP_VBRK.

READ TABLE ITAB_VBRK WITH KEY VBELN = TEMP_VBRK-VBELN.

IF SY-SUBRC EQ '0'.

TEMP_VBRK-BUKRS = '54'.

*TEMP_VBRK-VBELN = ITAB_VBRK-VBELN.

TEMP_VBRK-GJAHR = '2007'.

TEMP_VBRK-GSBER = 'MKTG'.

TEMP_VBRK-HKONT = '2711001'.

MODIFY TEMP_VBRK TRANSPORTING BUKRS GJAHR GSBER HKONT.

ENDIF.

ENDLOOP.

*getting data from bseg

IF NOT TEMP_VBRK[] IS INITIAL.

SELECT BUKRS BELNR GJAHR SHKZG GSBER WRBTR PSWSL VBELN HKONT KUNNR

ZFBDT FROM BSEG INTO CORRESPONDING FIELDS OF TABLE ITAB_BSEG

FOR ALL ENTRIES IN TEMP_VBRK

WHERE BUKRS = TEMP_VBRK-BUKRS

AND BELNR = TEMP_VBRK-VBELN

AND GJAHR = TEMP_VBRK-GJAHR

AND GSBER = TEMP_VBRK-GSBER

AND HKONT = TEMP_VBRK-HKONT.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
86

Hi Ricky,

Just check what is value being passed for BELNR field. If this is less than 10 chars then use FM CONVERSION_EXIT_ALPHA_INPUT for this field while populating table temp_vbrk.

then try the same once. I hope this is the issue because of the conversion exit.

Thanks,

Lalit

4 REPLIES 4

Former Member
0 Kudos
87

Hi Ricky,

Just check what is value being passed for BELNR field. If this is less than 10 chars then use FM CONVERSION_EXIT_ALPHA_INPUT for this field while populating table temp_vbrk.

then try the same once. I hope this is the issue because of the conversion exit.

Thanks,

Lalit

0 Kudos
86

NO IT'S OK AS PER LENGTH

0 Kudos
86

hi Ricky,

change this line:

TEMP_VBRK-HKONT = '2711001'.

to:

TEMP_VBRK-HKONT = '0002711001'.

ec

0 Kudos
86

Hi Eric,

Thanks for your valuable advise.It's really help me out.

Thanks a lot.

Please give me ur email id so further I can ask you dout.