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

Read Info from a structure

Former Member
0 Likes
2,234

Hi all.

I'm currently trying to do a report that only wants to look at active production orders. The only place i can find this information is in the structure 'CAUFVD' field 'ASTTX'.

Can anyone suggest the best way to pull this info into my report.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,002

Hi,

Since yours is a custom report and the structure will be only populated during runtime best way to use it through a Function Module.

CALL FUNCTION 'STATUS_TEXT_EDIT'

EXPORTING

objnr = t_caufvd_tab-objnr

only_active = yx

flg_user_stat = yx

spras = sy-langu

IMPORTING

anw_stat_existing = t_caufvd_tab-astex

line = t_caufvd_tab-sttxt

user_line = t_caufvd_tab-asttx "Your field

EXCEPTIONS

object_not_found = 01.

Regards,

Subhashini

Hi all.

I'm currently trying to do a report that only wants to look at active production orders. The only place i can find this information is in the structure 'CAUFVD' field 'ASTTX'.

Can anyone suggest the best way to pull this info into my report.

Thanks

9 REPLIES 9
Read only

Former Member
0 Likes
2,002

I looked through SE84 and found this: T627T.

Please check if it serves your purpose.

pk

Read only

naveen_inuganti2
Active Contributor
0 Likes
2,002

Hi,

Look into T627 and T627T tables. These may useful.

Or..,

Let me know the transaction code for this scenorio. By using SQL Trace .. we can trace the Table. Remember retrieving data from Structure is not possible... There should be a table for this.

Thanks,

Naveen.I

Read only

Former Member
0 Likes
2,003

Hi,

Since yours is a custom report and the structure will be only populated during runtime best way to use it through a Function Module.

CALL FUNCTION 'STATUS_TEXT_EDIT'

EXPORTING

objnr = t_caufvd_tab-objnr

only_active = yx

flg_user_stat = yx

spras = sy-langu

IMPORTING

anw_stat_existing = t_caufvd_tab-astex

line = t_caufvd_tab-sttxt

user_line = t_caufvd_tab-asttx "Your field

EXCEPTIONS

object_not_found = 01.

Regards,

Subhashini

Read only

0 Likes
2,002

Function modules always confuse me. Could you have a quick look at this code and let me know what the field names should be.


  SELECT bb~aufnr aa~plnbez dd~maktx ee~mvgr5
         aa~gamng aa~ftrms
    FROM afko AS aa INNER JOIN aufk AS bb ON aa~aufnr  = bb~aufnr
                    INNER JOIN afpo AS cc ON aa~aufnr  = cc~aufnr
                    INNER JOIN makt AS dd ON aa~plnbez = dd~matnr
                    INNER JOIN mvke AS ee ON aa~plnbez = ee~matnr

    INTO CORRESPONDING FIELDS OF TABLE it_prod_ord_comps
    WHERE aa~plnbez      IN s_plnbez   AND
          bb~aufnr       IN s_aufnr    AND
          bb~auart       =  'PP01'     AND
          bb~loekz       NE 'X'        AND
          cc~elikz       NE 'X'.

with this i collect all the production orders, I then need to get the status for them with this FM.

Many thanks

Read only

0 Likes
2,002

Hi,

You will get all the orders in the field AUFNR of the table which you populated.

From AUFNR you should get OBJNR using the database view CAUFV like this.

SELECT OBJNR FROM CAUFV

INTO TABLE T_OBJNR

FOR ALL ENTRIES IN T_AUFNR "Your internal table

WHERE AUFNR = T_AUFNR-AUFNR.

For that OBJNR pass all the values in a loop like this:-

LOOP AT T_OBJNR INTO WA_OBJNR.

CALL FUNCTION 'STATUS_TEXT_EDIT'

EXPORTING

FLG_USER_STAT = 'X'

OBJNR = WA_OBJNR

ONLY_ACTIVE = 'X'

SPRAS = 'EN'

IMPORTING

LINE = CAUFVD-STTXT

USER_LINE = CAUFVD-ASTTX

EXCEPTIONS

OBJECT_NOT_FOUND = 1

OTHERS = 2.

ENDLOOP.

Regards,

sUBHASHINI

Read only

0 Likes
2,002

also this FM only seems to return field STTXT not ASTTX

Read only

0 Likes
2,002

just one last question, with this function module how do i get the status into my earier internal table field

eg. t_mytable-asttx

thanks

Read only

0 Likes
2,002

Hi,

You get the value in the structure CAUFVD-ASTTX right.

What do u mean by earlier interanl table field?

Regards,

Subhashini

Read only

Former Member
0 Likes
2,002

The transaction is CO02