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

lips table

Former Member
0 Likes
3,517

hi all,

Here with am sending the code also. In that i got data for itab_likp. Am not getting data for jtab_lips.

I execute the both tables with vbeln value the data s there then y am not getting data..

Pl guide me..

TYPE-POOLS: SLIS.

TABLES: LIKP,LIPS.

DATA: BEGIN OF ITAB_LIKP OCCURS 0,

BLDAT LIKE LIKP-BLDAT,

VBELN LIKE LIKP-VBELN,

BTGEW LIKE LIKP-BTGEW,

END OF ITAB_LIKP.

DATA: BEGIN OF JTAB_LIPS OCCURS 0,

VBELN LIKE LIKP-VBELN,

MATNR LIKE LIPS-MATNR,

ARKTX LIKE LIPS-ARKTX,

VRKME LIKE LIPS-VRKME,

END OF JTAB_LIPS.

selection-screen begin of block b with frame title t1.

select-options: date_pos for LIKP-BLDAT.

SKIP 2.

select-options: DCN for LIKP-VBELN.

SELECTION-SCREEN END OF BLOCK B.

INITIALIZATION.

T1 = 'DELIVERY CHALLAN '.

start-of-selection.

SELECT BLDAT VBELN BTGEW FROM LIKP INTO CORRESPONDING FIELDS OF TABLE ITAB_LIKP

WHERE BLDAT IN DATE_POS AND VBELN IN DCN.

SELECT MATNR ARKTX VRKME FROM LIPS INTO CORRESPONDING FIELDS OF TABLE JTAB_LIPS

FOR ALL ENTRIES IN ITAB_LIKP

WHERE VBELN = ITAB_LIKP-VBELN.

Regards:

Manoj

6 REPLIES 6
Read only

Former Member
0 Likes
2,328

If likp is not initial.

-


only then fetch the record form lips.

endif.

Whenever we are using For All Entries,

remember to check whether the previous table is empty or not.

Just try doing this.

Read only

Former Member
0 Likes
2,328

Hi,

Ur code works fine.

May be the problem with ur data,

Check whether the tables have that particular selection screen value.

As said in the above reply check NOT initial condition and add VBELN in the 2nd select query.

Read only

Former Member
0 Likes
2,328

Hi,

Put a break point on the second select query and check whether IT_LIKP has got any value for VBELN or not?

Your code should be like this.

start-of-selection.

SELECT BLDAT VBELN BTGEW FROM LIKP INTO CORRESPONDING FIELDS OF TABLE ITAB_LIKP

WHERE BLDAT IN DATE_POS AND VBELN IN DCN.

IF IT_LIKP IS NOT INITIAL.

SELECT MATNR ARKTX VRKME FROM LIPS INTO CORRESPONDING FIELDS OF TABLE JTAB_LIPS

FOR ALL ENTRIES IN ITAB_LIKP

WHERE VBELN = ITAB_LIKP-VBELN.

ENDIF.

Read only

Former Member
0 Likes
2,328

Hi Manoj,

IN jtab_lips table you declared 4 fields in the internal table structure. You are reading only 3 fields from the select statement.

Whenever you use for all entries statement just check whether itab_likp is initial or not.

Else you will get unknown values and performance will be very slow.

Check your code once and modify it completley. Your code affects database worsely.

Rgds,

Santosh Kumar Mukka.

Read only

Former Member
0 Likes
2,328

Hi Manoj,

do it this way:

TYPE-POOLS: SLIS.

TABLES: LIKP,LIPS.

DATA: BEGIN OF WA_LIKP,
BLDAT LIKE LIKP-BLDAT,
VBELN LIKE LIKP-VBELN,
BTGEW LIKE LIKP-BTGEW,
END OF WA_LIKP.

DATA:
  ITAB_LIKP LIKE TABLE OF WA_LIKP.

DATA: BEGIN OF WA_LIPS,
VBELN LIKE LIKP-VBELN,
MATNR LIKE LIPS-MATNR,
ARKTX LIKE LIPS-ARKTX,
VRKME LIKE LIPS-VRKME,
END OF WA_LIPS.

DATA:
  JTAB_LIPS LIKE TABLE OF WA_LIPS.

selection-screen begin of block b with frame title t1.

select-options: date_pos for LIKP-BLDAT.
SKIP 2.
select-options: DCN for LIKP-VBELN.

SELECTION-SCREEN END OF BLOCK B.
INITIALIZATION.
T1 = 'DELIVERY CHALLAN '.

start-of-selection.
SELECT BLDAT VBELN BTGEW FROM LIKP INTO CORRESPONDING FIELDS OF
TABLE ITAB_LIKP
WHERE VBELN IN DCN AND BLDAT IN DATE_POS.

IF ITAB_LIKP IS NOT INITIAL.
SELECT MATNR ARKTX VRKME FROM LIPS INTO CORRESPONDING FIELDS OF
TABLE JTAB_LIPS
FOR ALL ENTRIES IN ITAB_LIKP
WHERE VBELN = ITAB_LIKP-VBELN.
ENDIF.

With luck,

Pritam.

Edited by: Pritam Ghosh on Jan 23, 2009 1:48 PM

Edited by: Pritam Ghosh on Jan 23, 2009 1:59 PM

Read only

Former Member
0 Likes
2,328

Hi,

The problem is that you are not selecting the VBELN and POSNR , that uniquely identify a Delivery item in the internal table. Hence, right now only the unique materials are being selected.

You need to change the second query as follows :


DATA: BEGIN OF jtab_lips OCCURS 0,
vbeln LIKE likp-vbeln,
posnr LIKE lips-posnr,   " Add the posnr field
matnr LIKE lips-matnr,
arktx LIKE lips-arktx,
vrkme LIKE lips-vrkme,
END OF jtab_lips.


...

  SELECT bldat vbeln btgew FROM likp INTO CORRESPONDING FIELDS OF TABLE
  itab_likp
  WHERE bldat IN date_pos AND vbeln IN dcn.

if itab_likp[] is not initial. " Of couse put this check, as others have mentioned,

  SELECT vbeln posnr matnr arktx vrkme FROM lips INTO CORRESPONDING
FIELDS OF TABLE
  jtab_lips
  FOR ALL ENTRIES IN itab_likp
  WHERE vbeln = itab_likp-vbeln.

endif.

Notice that I've added the VBELN and POSNR in the select statment.

Now you will get the desired result.

regards,

Advait