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: 

Getting data into the fields

former_member612655
Participant
0 Kudos
718

Hi Experts,

I want to display "ersda" field from mara table. But unfortunately I don't getting the data of ersda field can you please help me to solve the issue .for generating the report I used for all entries .In my report I used mara Marc mseg malt mbew tables

5 REPLIES 5

konstantin_anikeev
Active Contributor
0 Kudos
599

this is a normal data field, the only problem can be, if you building field catalog manually. If you will try to get components of mara table for display - you may get include, where ersda field is placed. sou you may need to unwrap include EMARA

Best Regards

Konstantin

former_member1716
Active Contributor
0 Kudos
599

Hello,

Can you please help us with below questions regarding this issue,

1) Does your table have data?

2) How many tables do you have in the select query and what are they?

3) How you are displaying the data, which method/FM do you use for ALV display?

4) When you say you are getting the data, tell us clearly from where you are not getting the data. is it from table to internal table or you are not able to display from internal table to report outside?

Kindly make your self clear when you ask a question in the forum so which will helpful to get quick repsonses

Regards

0 Kudos
599

1) Does your table have data?

-->yes i am retriving the data from mara table it has data.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; }

BEGIN OF ty_mara,
matnr TYPE matnr,
lvorm TYPE lvorm,
mtart TYPE mtart,
ersda Type ersda,
END OF ty_mara,

2) How many tables do you have in the select query and what are they?

two tables mara, marc

3) How you are displaying the data, which method/FM do you use for ALV display?

FORM get_alv .
s_layo-cwidth_opt = 'X'.
s_layo-zebra = 'X'.
PERFORM sub_create_fcat USING :
'MATNR' 'Material Code' 'MARA' 'MATNR' ,
'TXZ01' 'Material Description' 'MARA' 'MAKTX' ,
'MTART' 'Material type' 'MARA' 'MTART' ,
'PRCTR' 'Profit center' 'MARC' 'PRCTR' ,
'VPRSV' 'Price Control' 'MBEW' 'VPRSV' ,
'PRICE' 'Price' 'MBEW' 'STPRS' ,
'BESKZ' 'Procurement type' 'MARC' 'BESKZ' ,
'SOBSL' 'Special procurement type' 'MARC' 'SOBSL' ,
'NO_BOM' 'No BOM' '' 'CHAR1' ,
'NO_ROUTING' 'No Routing' '' 'CHAR1' ,
'ERSDA' 'Created on' 'MARA' 'ERSDA'.

4) When you say you are getting the data, tell us clearly from where you are not getting the data. is it from table to internal table or you are not able to display from internal table to report outside?

FORM get_mara .
REFRESH:s_mtart1[].
IF s_mtart[] IS INITIAL.
s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = 'ZANL'.
APPEND s_mtart1.

s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = 'ZFRT'.
APPEND s_mtart1.

s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = 'ZHLB'.
APPEND s_mtart1.

s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = 'ZROH'.
APPEND s_mtart1.
ENDIF.

IF s_mtart[] IS NOT INITIAL.
LOOP AT s_mtart.
IF s_mtart-LOW = 'ZANL' OR s_mtart-LOW = 'ZFRT' OR s_mtart-LOW = 'ZHLB' OR S_MTART-LOW = 'ZROH'.
s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = s_mtart-LOW.
APPEND s_mtart1.
ENDIF.
ENDLOOP.
ENDIF.

IF s_mtart1[] IS INITIAL.
MESSAGE 'Please select Material Type as ZANL/ZFRT/ZHLB' TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.


CHECK t_marc IS NOT INITIAL.
SELECT matnr
lvorm
mtart
ersda
FROM mara
INTO TABLE t_mara
FOR ALL ENTRIES IN t_marc
WHERE matnr = t_marc-matnr
AND mtart IN s_mtart1 . "( mtart = 'ZANL' OR MTART = 'ZHLB' OR MTART = 'ZFRT'). ""
* AND lvorm = v_ch.
IF SY-SUBRC = 0.
IF p_ch IS NOT INITIAL.
DELETE T_MARA WHERE LVORM IS NOT INITIAL.
ENDIF.
ENDIF.
ENDFORM. " GET_MARA

this logic was i developed but i am not getting the data

0 Kudos
599

I would suggest to debug the code, you can figure it out the issue by yourself.

former_member1716
Active Contributor
0 Kudos
599

Hello,

Remove the below Code from you code:

IF s_mtart[] IS NOT INITIAL.
LOOP AT s_mtart.
IF s_mtart-LOW = 'ZANL' OR s_mtart-LOW = 'ZFRT' OR s_mtart-LOW = 'ZHLB' OR S_MTART-LOW = 'ZROH'.
s_mtart1-SIGN = 'I'.
s_mtart1-OPTION = 'EQ'.
s_mtart1-LOW = s_mtart-LOW.
APPEND s_mtart1.
ENDIF.
ENDLOOP.
ENDIF.

Why are you adding the entries again into S_MTART which is already there?

Also i see you are filling the data if S_MTART is initial. In that case why are you displaying a error message as you are always going to have the value in S_MTART.

Now, Put a break point in your select Query and see if the program reaches that point. Am afraid if your below statement is successful.

CHECK t_marc IS NOT INITIAL.

Since you say that you only have ERSDA field value you are fetching, can you show the entries in table T_MARA?

Regards