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

Problem with joining 3 tables

Former Member
0 Likes
976

Hi,

The following is my join code and internal table declaration:

  • BEGINOF/ENDOF INTERNAL TABLE

DATA: BEGIN OF I_MARC_VALUES OCCURS 0,

WERKS LIKE MARC-WERKS,

DISPO LIKE MARC-DISPO,

DISMM LIKE MARC-DISMM,

ZZLIFNR LIKE MARC-ZZLIFNR,

MMSTA LIKE MARC-MMSTA,

MATNR LIKE MARA-MATNR,

MAKTX LIKE MAKT-MAKTX,

EKGRP LIKE MARC-EKGRP,

END OF I_MARC_VALUES.

-


SELECT

MARC~WERKS

MARC~DISPO

MARC~DISMM

MARC~ZZLIFNR

MARC~MMSTA

MARA~MATNR

MAKT~MAKTX

MARC~EKGRP

FROM MARC

INNER JOIN MARA ON MARAMATNR = MARCMATNR

INNER JOIN MAKT ON MAKTMATNR = MARCMATNR

INTO CORRESPONDING FIELDS OF TABLE I_MARC_VALUES

WHERE EKGRP = P_GROUP.

BREAK-POINT.

WRITE: / I_MARC_VALUES.

-


However, the output produces a blank screen.

What is the problem and what can i do to solve it?

Points will be rewarded and all answers will be greatly appreciated.

Thank You,

John

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
950

Hi,

TO display use LOOP AT internal table ...

Ex..

LOOP AT I_MARC_VALUES.

WRITE: / I_MARC_VALUES.

ENDLOOP.

Thanks,

Naren

7 REPLIES 7
Read only

Former Member
0 Likes
951

Hi,

TO display use LOOP AT internal table ...

Ex..

LOOP AT I_MARC_VALUES.

WRITE: / I_MARC_VALUES.

ENDLOOP.

Thanks,

Naren

Read only

Former Member
0 Likes
950

Hi,

Change the write statement as below.

Loop at I_MARC_VALUES.

Write:/ I_MARC_VALUES-WERKS,

I_MARC_VALUES-DISPO,

I_MARC_VALUES-ZZLIFNR,

I_MARC_VALUES-MMSTA,

I_MARC_VALUES-MATNR,

I_MARC_VALUES-MAKTX ,

I_MARC_VALUES-EKGRP.

endloop.

Regards,

Atish

Read only

Former Member
0 Likes
950

Hi JOhn,

SELECT

MARC~WERKS

MARC~DISPO

MARC~DISMM

MARC~ZZLIFNR

MARC~MMSTA

MARA~MATNR

MAKT~MAKTX

MARC~EKGRP

FROM MARC

INNER JOIN MARA ON MARAMATNR = MARCMATNR

INNER JOIN MAKT ON MAKTMATNR = MARCMATNR

INTO CORRESPONDING FIELDS OF TABLE I_MARC_VALUES

WHERE <b>MARC~EKGRP</b> = P_GROUP.

BREAK-POINT.

<b>LOOP AT I_MARC_VALUES.

Write:/ I_MARC_VALUES-WERKS,

I_MARC_VALUES-DISPO,

I_MARC_VALUES-ZZLIFNR,

I_MARC_VALUES-MMSTA,

I_MARC_VALUES-MATNR,

I_MARC_VALUES-MAKTX ,

I_MARC_VALUES-EKGRP.

endloop.</b>

If u still get blank screen then check the tables manually for records in the provided group.

Regards

SAB

Read only

Former Member
0 Likes
950

Hi john,

Use the loop stamemnt and don't go for inner join, better use for all entries,so that ur processing will be faster..

REPORT ZNEW .

PARAMETER P_GROUP TYPE MARC-EKGRP.

*BEGINOF/ENDOF INTERNAL TABLE

DATA: BEGIN OF I_MARC_VALUES OCCURS 0,

WERKS LIKE MARC-WERKS,

DISPO LIKE MARC-DISPO,

DISMM LIKE MARC-DISMM,

*ZZLIFNR LIKE MARC-ZZLIFNR,

MMSTA LIKE MARC-MMSTA,

MATNR LIKE MARA-MATNR,

MAKTX LIKE MAKT-MAKTX,

EKGRP LIKE MARC-EKGRP,

END OF I_MARC_VALUES.

SELECT

MARC~WERKS

MARC~DISPO

MARC~DISMM

*MARC~ZZLIFNR

MARC~MMSTA

MARA~MATNR

MAKT~MAKTX

MARC~EKGRP

FROM MARC

INNER JOIN MARA ON MARAMATNR = MARCMATNR

INNER JOIN MAKT ON MAKTMATNR = MARCMATNR

INTO CORRESPONDING FIELDS OF TABLE I_MARC_VALUES

WHERE EKGRP = P_GROUP.

*BREAK-POINT.

LOOP AT I_MARC_VALUES.

WRITE: / I_MARC_VALUES-WERKS.

ENDLOOP.

try with this program..It's executing..

Reward if it's useful..

Reg,

Manoj.

Read only

Former Member
0 Likes
950

hi john..

The screen shows blank because there is no data's in the field ekgrp..

Give the input as 220 in P_GROUP..

Read only

Former Member
0 Likes
950

first of all since P_GROUP is an parameter you should enter a value in that other wise it will not fetch any data. Just check the table entry for P_GROUP and give that in parameter...now in break point check the sy-subrc value is 0 or not. if it is 0 then you have to use loop at itab.endloop. as suggested by others...if sy-subrc not equals 0 then check the table entry....

regards

shiba dutta

Read only

Former Member
0 Likes
950

Hi

Make sure that to write the internal table you are using a loop....endloop statement..Also make sure that your parameter contains some value.....

Reward all helpfull answers......