Skip to Content
-4

I don't know where is my problem?

Nov 15, 2016 at 02:19 PM

86

avatar image

Hello,

i got some problem with my function with several SELECT i try to find why this one doesn't work but unfortunately no

TYPES: BEGIN OF ty_lqua,

lgnum TYPE ltap-lgnum,

tanum TYPE ltap-tanum,

tapos TYPE ltap-tapos,

matnr TYPE ltap-matnr,

werks TYPE ltap-werks,

vltyp TYPE ltap-vltyp,

lgort TYPE ltap-lgort,

END OF ty_lqua.

DATA: wt_confirm_data TYPE TABLE OF ZDMOTS_TO_CONFIRM_DATA.

DATA: wt_ltap_conf TYPE TABLE OF ltap_conf. DATA: wt_ltap TYPE TABLE OF ty_lqua.

*The request in the table LTAP to complete the table wt_ltap

SELECT lgnum tanum tapos matnr werks vltyp lgort

FROM ltap

INTO TABLE wt_ltap

FOR ALL ENTRIES IN wt_ltap_conf

WHERE tanum = wt_ltap_conf-tanum AND tapos = wt_ltap_conf-tapos.

(The table wt_ltap is complet with the function in input table)

* The request to complete the output extra "confirm_data"

* with wt_confirm_data

SELECT a~matnr a~werks a~lgort a~labst

b~meins

c~lgnum c~lgpla c~gesme c~verme c~meins

FROM mard AS a

INNER JOIN lqua AS c

ON c~matnr = a~matnr

AND c~werks = a~werks

AND c~lgort = a~lgort

INNER JOIN mara AS b

ON b~matnr = c~matnr

INTO TABLE wt_confirm_data

FOR ALL ENTRIES IN wt_ltap

WHERE c~lgnum = wt_ltap-lgnum

AND a~matnr = wt_ltap-matnr

AND a~werks = wt_ltap-werks

AND c~lgort = wt_ltap-lgort

AND a~lvorm IS null

AND b~lvorm IS null.

confirm_data[] = wt_confirm_data[].

Confirme_data is my extra output table

I hope u'll or i'll find what is wrong

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Amit Dahiya Nov 15, 2016 at 05:45 PM
1

Hello,

I think you are missing some of the your code to paste here. But if this is all the code you have in your program then it will not fetch anything as you are not populating 'wt_ltap_conf' or 'wt_confirm_data' anywhere.

'ltap_conf' is not defined anywhere, so ideally you should already get syntax error in your code.

Also you did not mention if you are getting any errors? Or are you not able to select desired data?

Please let us know.

Thank you

Amit

Share
10 |10000 characters needed characters left characters exceeded
Sylvain ANDRÉ Nov 16, 2016 at 07:43 AM
1

I find what was wrong in this code,

AND a~lvorm IS null

AND b~lvorm IS null.


I try with this one but this is doesn't work on the environement where i work.

The solution was:

AND a~lvorm = space

AND b~lvorm = space.


Amit Dahiya: I didn't put all my code cause i think it was useless but the next time i'll do it.

ModeratorJürgen L : Ok sorry.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

IS NULL is a false friend, it works only in very special cases, so as a rule-of-thumb never use it (cf the ABAP documentation)

0