2009 Nov 13 11:47 AM
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
2009 Nov 13 12:02 PM
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
2009 Nov 13 11:58 AM
I looked through SE84 and found this: T627T.
Please check if it serves your purpose.
pk
2009 Nov 13 12:01 PM
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
2009 Nov 13 12:02 PM
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
2009 Nov 13 12:24 PM
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
2009 Nov 13 12:44 PM
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
2009 Nov 13 12:44 PM
2009 Nov 13 1:02 PM
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
2009 Nov 13 1:56 PM
Hi,
You get the value in the structure CAUFVD-ASTTX right.
What do u mean by earlier interanl table field?
Regards,
Subhashini
2009 Nov 13 12:21 PM