Production order not coming in MD04 list
Dear PP gurus,
In the PIR i have entered a qty lets say 20 for a month for a FG , when i run the MRP system generated planned order for dependent req. and which i converted into production order.(20 qty)
During confirmation in CO11, , the yield qty is 15 and rework is 5 .
Now for the 5 qty in rework, i have created manually a rework production order with a differnt order type for example (ZR01).
and confirm the same and done the GR for the 5 qty .
When I check the MD04 (stock req list ), In the avilable qty it is showing totao stock 20 ( 15 which i confirmed earlier and 5 which i confirmed against rework)
but it is not showing the manual production order which i created with diffenent order type . Is it correct?
else in the customization anything needs to be done so that this order type should also refelect in the MD04
pls help.
Regards
Adhish
Hi,
Once you confirm & receive the rework order, the inventory is updated as seen by you the stock is 20. So the rework order will not show up in MD04.
Only orders which are not delivered completely & not TECO or having any restricted processing status will show up in MD04.
Hope the above clarifies.
Regards,
Vivek
Similar Messages
-
Sales order not shown in MD04 and product view
Hi All,
Sales order is created,but its not showing in MD04 and RRP3,The material type is X0.
I checked the status of the sales order that is blocked for authorization,Is there any other reason for this.
Regards,
PrabhuHi,
In the sales order, please check the item category in the schedule lines.
If the item category is CN, then you cannot see the requirements in MD04.
The item category is determined from the MRP type set in the material master. Since it was ND earlier, the Item category in the sales order became CN.
Had the sales order been created after changing the MRP type, the Item category would have been CP and you can see the requirements in MD04.
You can change the item category in the schedule line to CP and the requirements will be transferred to MD04.
Once they are in MD04, they would automatically come to RRP3, provided the material exists in the active integration model.
Regards, -
SAP Production Order not closing
Hi there,
I am running the COHV with Complete parameter in the background, and it does pick up several TECO orders from the past, like say from 2009 which are not closed but it does not process them to CLSD status.
I am seeing some entries in COHV, CO1P, COFC transactions - I picked a few randomly to check.
The order qty is not always equal to the delivered qty - Again a random test
The consumption qty on the components is not always equal to the required qty, which leaves reservation open - random check
Is all the above causing my order not to close ? where do I see the error log, when I try to close the order. I wrote the above issues based on my random check.
Thank youHi SAP Process,
When you run COHV to close the orders, you can see the log with the list of orders that have not been closed.
To see in detail what has happened you will need to check order by order.
Other option will we to evaluate each situation separatelly. You can check COGI, CO1P, see open reservations, check if you have TR or TO if you use WM, etc.. Once each situation is cleaned, you will be able to closed most of your production orders. It is quite common to create a custom report to make all these checks (COGI, TR/TOs, etc) and closed the orders.
Kind Regards,
Mariano -
Sales orders not appearing in MD04
Hi,
Certain sales orders are not appearing in MD04. They belong to a particular sales organization. What could be the reason and how to resolve such thing.
regards
sachinsachin arora wrote:>
> Hi,
>
> Certain sales orders are not appearing in MD04. They belong to a particular sales organization. What could be the reason and how to resolve such thing.
>
> regards
>
> sachin
Hi Sachin,
MD04 is the stock requirement listing.
Normally it would not list general sales order that is Make to STOCK scenarion. It would not list those sales order as that requirment is taken care by PIR (planned independant Requirment).
However in scenarios like MTO (Make to Order) or Plan to assemble to name a few. MD04 will list the sales order.
For that you need to change the STRATEGY GROUP in Material Master to Planning with Asembly or Make to Order in MRP3 Tab.
Once you save the sales order for such a material it will get listed in MD04.
Hope it helps.
Thanks & Regards
Abhishek Swarup -
Rework Production Order not able to confirm and no cost calculation
Hi Guys,
During rework production order confirmation system giving error message as below:
[Item category 01001 not allowed in accounting transaction 0000/0001
Message no. GLT2001
Diagnosis
The online document splitting is active in your system. Here, each document is assigned to a accounting transaction variant and each document row to an item category. You determine for each business transaction variant which item categories can or must be posted here.
The following error occurred for the document you entered:
Item category 01001 in accounting transaction 0000, variant 0001 is no allowed.
System Response
The document cannot be posted.
Procedure
Check the document entered, the derivation of the business transaction variant, the derivation of the item category, and the assignment of the item categories to the business transaction variant.
Procedure for System Administration]
This error relating to New G/L split functionality such as the document type and G/L accounts document type. Doc type is using as same as normal production order and normal production order confirmations and other activities are posted successfully. Iu2019m in a puzzle, regards to this behavior of rework order?
Back ground for rework order:
Rework order was created through trigger points.
Rework order doesn't have any material, it has to pick and settle to original production order; the same was defined at re-work order settlement.
Rework order not doing any cost calculations at production order level itu2019s giving a message as below:
Object was not costed
Message no. CK060
Diagnosis
The system could not find any entries that are relevant to costing.
System Response
The system did not cost the object.
Procedure
Check whether the following objects should be flagged as relevant to costing:
- Items in the BOM
- Display BOM
- Operations in the routing
- Control key in the routing
1. Look at the message log.
2. Check whether a quantity was specified in the confirmation.
Will some one throw some light to come out from this situation and what I missed out and what need to be maintained exactly Plz.
Thanks in advanceu2026VyasHi Mangalraj,
Have check the BOM & Routing for Parent production order costing check box is for both. Coming to rework order doesn't have any material, though it has pulled the some material cost from parent production order. The same can see at production order costs>analysis, but where as costs>itemization not able to see and mesage issued like: object was not costed.
as early mentioned, confirmation level same error.
Hope this may give some idea on this case, thanks for your time on this.
Looking forward some light.
Thanks...Vyas -
Production orders not updated in Live Cache
Hi All,
We are currently facing a strange issue. Planned orders created in APO are converted into Production orders in R/3. When they are CIFfed to APO, those prodcution orders are captured in Product view but are not updated in either /SAPAPO/OM16 or Production list (/SAPAPO/PPL1). In these two transactions the production orders are not visible but their respective planned orders are showing up.
When delta report is executed for Production orders with "Consider Requirements/Receipts" as sub-object, these orders are captured with Error code 501 (Requirement/Receipt for the order exists only in R/3). When pushed to APO, these orders are updated in the Live Cache.
Can anyone share your thoughts on what could be the root cause for this issue.
Appreciate your thoughts
Thanks,
SaiThanks Vikas and Senthil,
Its not the issue with all the Production orders. The issue is with only few orders and we are in the process of tracing out the pattern.
Our Primary concern is that the orders captured in the delta report are visible in Product view even without taking any action in CCR but are missing in OM16. Its only after taking the action those orders are visible in OM16. I believe the data in the product view is read from Live Cache and the Live Cache contents are displayed in OM16. So, whatever orders visible in Product view have to be displayed in OM16 which is not happening.
Please let me know if I am missing anything.
Thanks,
Sai -
Header is not coming in alv list display- urgent
hi all,
i am sending my code below....
my requirement is in selection screen i have 4 radio buttons . if i click 1 radio button it will duiisplay data and and its header. report is working fine. my requirement id when i click r_mssng radio button(missing radio button) it is showing data correctsly. here i want to show header as 'Missing details report'.
this is not coming in my report. anybody can suggest me.
i am sending my code below....
report zvra0001ftb13 message-id zv.
Confidential and Proprietary
* Celestica Corporation
* All Rights Reserved
*ABAP Name: ZVRA0001FTB13
*Created by: Srinivasa Chakravarthi
*Created on: 26/03/2003
*SAP Version: 4.6 C
*Description: This report displays details of foreign trades
and EHS based on the deliveries made to the outside
countries.
*Input: Selection Screen Criteria includes country of
origin,Company code, Sales Organisation,
Ship-to-party, Sold-to-paarty, Goods movement date,
Invoice number, Invoice type, Material , Material
Type, Exporter ID, Province of origin.
*Output: ALV output that contains Mode of Transport, Export
HS number, Commodity Description, Quantity, UOM,
Value, Country of Destination, Goods Origin
*Dependency: Nil
*Modification Log:
*CR# Date Coded Transport Description
*====== ======== ========= ============= ===============================
*5147 26/03/2003 Srinivas ED1K922286 New Development
*8700 02/11/2004 H.Arular ED1K938380 To check if entries of Comm
Code(HS code)is less than 8
digits and give a warning
message.
*18684 25/07/2007 MAHEEDHAR Merge the logic from report
ZVRA0001FTB13_ERROR into
report ZVRA0001FTB13 and
added two radio buttons
called missing data and non
missing data, addedc logic
accoriding to the radio
buttons.
*Declaring Tables.
tables: likp, "Delivery document Header
lips, "Delivery Document Item
vbfa, "Sales document Flow
bkpf, "Accounting Document Header
eikp, "Foreign Trade:Export/Import Data
eipo, "Foreign Trade:Export/ Import
"Header data
t618t, "Forein Trade:Mode of Transport
"Description
t604t, "Foreign Trade: Commodity Code/
"Import Code number Description.
mara, "Material master data.
t005, "Countries
t001, "Company Codes
tvko, "Sales Organisations
kna1, "Customer Master
t003, "Document types
t134, "Material types
tvfk,
konv,
vbrk.
constants : c_rep like vbrk-fkart value 'YGFB',
c_for(10) value 'Foreign'.
*Decalre Type pool for ALV
type-pools: slis.
*Type declaration for LIKP.
types: begin of t_data1,
vbeln like likp-vbeln, "Delivery
kunnr like likp-kunnr,
end of t_data1.
*Type declaration for LIPS,VBFA.
types: begin of t_data2,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
vbelv like vbfa-vbelv, "Preceding SD document
posnv like vbfa-posnv, "Preceding item of SD document
matnr like lips-matnr, "Material Number
meins like lips-meins, "Base unit of measure
lfimg like lips-lfimg, "Actual Quantity Delivered
mtart like mara-mtart,
end of t_data2.
**Type declaration for BKPF.
*types: begin of t_data3,
belnr like bkpf-belnr, "Accounting Documnet number
bukrs like bkpf-bukrs, "Company Code
end of t_data3.
*Type declaration for BKPF.
types: begin of t_data3,
vbeln like vbrk-belnr, " Billing Doc
fkart like vbrk-fkart,
land1 like vbrk-land1,
end of t_data3.
*Type declaration for EIPO.
types: begin of t_data4,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
matnr like vbrp-matnr,
fkimg like vbrp-fkimg,
meins like vbrp-meins,
verld like eipo-verld, "Country of dispatch for Foreign
"trade
herkl like eipo-herkl, "Country of origin of material
grwrt like eipo-grwrt, "Statistical value for Foreign
" trade
stawn like eipo-stawn, "Commodity code for foreign trade
expvz like eikp-expvz, "Mode of transport for foreign
"trade
end of t_data4.
*Type declaration for T618T.
types: begin of t_data5,
land1 like t618t-land1, "Country key
expvz like t618t-expvz, "Mode of Transport
bezei like t618t-bezei, "Description
end of t_data5.
*Type declaration for T604T.
types: begin of t_data6,
land1 like t604t-land1, "Country key
stawn like t604t-stawn, "Commodity Code
text1 like t604t-text1, "Description
end of t_data6.
*Type declaration for T604T.
types: begin of t_mara,
matnr like mara-matnr,
end of t_mara.
types : begin of rep_val,
vbelv like vbfa-vbelv,
posnv like vbfa-posnv,
vbeln like vbfa-vbeln,
posnn like vbfa-posnn,
uepos like vbap-uepos,
posnr like vbap-posnr,
netwr like vbap-netwr,
end of rep_val.
types : begin of t_price,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
knumv like konv-knumv,
kposn like konv-kposn,
kbetr like konv-kbetr,
kpein like konv-kpein,
end of t_price.
data : t_sord type rep_val occurs 0 with header line.
data : t_dord type rep_val occurs 0 with header line.
data : t_rord type rep_val occurs 0 with header line.
data : t_hord type rep_val occurs 0 with header line.
data : t_ford type rep_val occurs 0 with header line.
data : i_price type t_price occurs 0 with header line.
data : i_price1 type t_price occurs 0 with header line.
data : i_mara type t_mara occurs 0 with header line.
data : i_sort type slis_t_sortinfo_alv.
DATA: t_layout TYPE slis_layout_alv.
*Declaring Selection screen.
selection-screen begin of block b1 with frame title text-101.
select-options:
s_verld for eipo-verld, "Country of Dest.
s_bukrs for bkpf-bukrs, "Company code
s_vkorg for likp-vkorg, "Sales Organisation
s_kunnr for likp-kunnr, "Ship-to-Party
s_kunag for likp-kunag, "Sold-to-party
s_wadat for likp-wadat_ist, "Goods Movement date
s_belnr for vbrk-vbeln, "Invoice number
s_blart for vbrk-fkart. "Invoice type.
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-101.
select-options:
s_matnr for mara-matnr, "Material
s_mtart for mara-mtart. "Material Type
selection-screen end of block b2.
selection-screen begin of block b3 with frame title text-101.
parameters:
p_export(30) type c default '1366770724RM' obligatory , "Exporter ID
p_provi(30) type c default 'ONTARIO' obligatory ,
p_sumid(30) type c default 'SUM0704'.
"Province of Origin
selection-screen end of block b3.
selection-screen begin of block b4 with frame title text-104.
parameters:
r_summ radiobutton group zsum,
r_dets radiobutton group zsum,
r_mssng radiobutton group zsum, " maheedhar
R_NMSNG RADIOBUTTON GROUP ZSUM. " MAHEEDHAR
selection-screen skip.
parameter : p_sum as checkbox .
selection-screen end of block b4.
selection-screen begin of block b5 with frame title text-105.
select-options : s_i_kun for likp-kunnr.
selection-screen end of block b5.
*Data Declaration
data: i_fieldcat type slis_t_fieldcat_alv.
data: l_fieldcat type slis_fieldcat_alv .
data: v_lin type i.
data: v_lfstk type c value 'C'.
data: v_vbtyp type c value 'U'.
data: i_data1 type t_data1 occurs 0 with header line.
data : begin of t_T005t occurs 0.
include structure t005t.
data : end of t_t005t.
data: i_data2 type t_data2 occurs 0 with header line.
data: t_delv type t_data2 occurs 0 with header line.
data: t_bild type t_data2 occurs 0 with header line.
data: i_data3 type t_data3 occurs 0 with header line.
data: i_data4 type t_data4 occurs 0 with header line.
data: i_data5 type t_data5 occurs 0 with header line.
data: i_data6 type t_data6 occurs 0 with header line.
*Declare Internal table for ALV output.
data: begin of i_output occurs 0,
belnr like vbrk-vbeln,
posnr like vbrp-posnr,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
strlen, "ED1K938380
end of i_output.
maheedhar-start.
data : i_output1 like i_output occurs 0 with header line,
i_output2 like i_output occurs 0 with header line.
maheedhar-end
data : buff_out like i_output occurs 0 with header line.
data: begin of t_outsum occurs 0,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
end of t_outsum.
data : v_ans.
data : variante LIKE disvariant.
data : v_repid LIKE sy-repid.
data : wa_listheader TYPE slis_listheader.
data : t_listheader TYPE slis_t_listheader.
data : b_text(250).
data: evntS type slis_t_event with header line. " MAHEEDHAR
EVENT AT SELECTION-SCREEN
at selection-screen.
*For Autorisation check
perform authorisation_check.
Validation of Selection screen
perform check_entry.
EVENT START-OF-SELECTION
start-of-selection.
*Get data
perform select_data.
**For calling ALV function modules
MAHEEDHAR - START
if r_mssng eq 'X'.
DELETE I_OUTPUT WHERE BEZEI NE SPACE AND
STAWN NE SPACE AND
HERKL NE SPACE AND
VERLD NE SPACE.
DESCRIBE TABLE I_OUTPUT LINES V_LIN.
IF V_LIN > 0.
PERFORM DISPLAY_OUTPUT.
ELSE.
MESSAGE E000 WITH TEXT-130.
ENDIF.
elseif R_SUMM eq 'X' OR R_DETS EQ 'X'. "ENDIF. " MAHEEDHAR
MAHEEDHAR-END
describe table i_output lines v_lin.
if v_lin > 0.
buff_out[] = i_output[].
Begin of ED1K938380
delete buff_out where stawn ne space or "ED1K938380
verld eq space or
herkl eq space.
delete buff_out where strlen ne 'X' or
verld eq space or
herkl eq space.
End of ED1K938380
describe table buff_out lines v_lin.
Lines with no commodity code exists.
if v_lin gt 0.
concatenate text-902 text-903 into b_text.
concatenate text-906 text-907 into b_text. "ED1K938380
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = Text-901
TEXT_QUESTION = b_text
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = v_ans.
if v_ans eq '1'.
perform display_output.
endif.
else.
perform display_output.
endif.
else. " MAHEEDHAR
message e000 with text-130.
endif.
MAHEEDHAR-START
*"-- If non missing details radiobutton is selected
elseif r_nmsng = 'X'.
*"-- move data from i_output to i_output1.
i_output1[] = i_output[].
sort i_output by belnr.
sort i_output1 by belnr.
*"-- to get missing data
delete i_output1 where bezei ne space and
stawn ne space and
herkl ne space and
verld ne space.
loop at i_output.
*"-- compare two int tables with respective document number
read table i_output1 with key belnr = i_output-belnr.
if sy-subrc ne 0.
move-corresponding i_output to i_output2.
append i_output2.
clear i_output2.
endif.
endloop.
describe table i_output2 lines v_lin.
if v_lin gt 0.
perform display_output.
else.
message e000 with text-130.
endif.
MAHEEDHAR-END.
ENDIF. " MAHEEDHAR
FORM SELECT_DATA *
form select_data.
Data:l_strlen type i. "ED1K938380
*Get details from LIKP.
if s_i_kun[] is initial.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' .
else.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
( ( likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' )
or
likp~kunnr in s_i_kun and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' ) .
endif.
if sy-subrc ne 0.
message e000 with text-200.
endif.
*Get details from table LIPS
select lips~vbeln
lips~posnr
vbfa~vbeln
vbfa~posnn
lips~matnr
lips~meins
lips~lfimg
mara~mtart
from lips
inner join vbfa on vbfavbelv = lipsvbeln
and vbfaposnv = lipsposnr
inner join mara on maramatnr = lipsmatnr
into table i_data2
for all entries in i_data1
where
lips~vbeln = i_data1-vbeln and
lips~matnr in s_matnr and
vbfa~vbeln in s_belnr and
mara~mtart in s_mtart and
vbfa~vbtyp_n = 'U'.
if sy-subrc ne 0.
message e000 with text-201.
endif.
t_delv[] = i_data2[].
t_bild[] = i_data2[].
sort t_delv by vbeln.
delete adjacent duplicates from t_delv comparing vbeln.
sort t_bild by vbeln ascending vbelv descending.
delete adjacent duplicates from t_bild comparing vbeln.
*Get details of Accounting document number
select vbeln fkart land1 from vbrk
into table i_data3
for all entries in t_bild
where vbeln = t_bild-vbelv and
bukrs in s_bukrs and
fkart in s_blart and
vkorg in s_vkorg and " MAHEEDHAR
land1 in s_verld. " MAHEEDHAR
sort i_data3.
*Get details from EIPO.
select vbrp~vbeln
vbrp~posnr
vbrp~matnr
vbrp~fkimg
vbrp~meins
eipo~verld
eipo~herkl
eipo~grwrt
eipo~stawn
eikp~expvz
from eikp
inner join vbrp on vbrp~vbeln = eikp~refnr
inner join eipo on eikp~exnum = eipo~exnum
and eipo~expos = vbrp~posnr
into table i_data4 for all entries in i_data3
where vbrp~vbeln = i_data3-vbeln.
eipo~verld in s_verld.
if sy-subrc ne 0.
message e000 with text-201.
endif.
IF R_MSSNG NE 'X' or r_nmsng = 'X'. " MAHEEDHAR
perform get_price.
ENDIF. " MAHEEDHAR
Get details from T618T.
select land1
expvz
bezei
from t618t
into table i_data5
for all entries in i_data4
where
land1 = 'CA' and " Getting for Canada only
expvz = i_data4-expvz and
spras = sy-langu.
select matnr from mara into table i_mara where matnr in s_matnr
and mtart in s_mtart.
Get details from T604T.
select land1
stawn
text1
from t604t
into table i_data6
for all entries in i_data4
where
land1 = i_data4-VERLD and
stawn = i_data4-stawn and
spras = sy-langu.
select * from T005t into table t_T005t where spras = sy-langu.
loop at i_data3.
loop at i_data4 where vbeln eq i_data3-vbeln.
clear : i_data1, i_data2.
read table i_data2 with key vbelv = i_data4-vbeln
posnv = i_data4-posnr.
read table i_data1 with key vbeln = i_data2-vbeln.
if not s_i_kun[] is initial.
check ( ( i_data1-kunnr in s_i_kun ) or
( i_data3-land1 in s_verld ) ).
else.
check i_data3-land1 in s_verld .
endif.
read table i_mara with key matnr = i_data4-matnr.
if sy-subrc eq 0.
read table i_data5 with key expvz = i_data4-expvz .
land1 = i_data3-land1.
read table i_data6 with key stawn = i_data4-stawn
land1 = i_data4-VERLD.
move i_data4-vbeln to i_output-belnr.
move i_data4-posnr to i_output-posnr.
move i_data5-bezei to i_output-bezei.
move i_data6-text1 to i_output-text1.
Begin of ED1K938380.
l_strlen = strlen( i_data4-stawn ).
if l_strlen < 8.
move 'X' to i_output-strlen.
endif.
End of ED1K938380.
move i_data4-stawn to i_output-stawn.
move i_data4-meins to i_output-meins.
read table t_T005t with key land1 = i_data3-land1.
move t_t005t-landx to i_output-verld.
if p_sum eq space.
if i_data4-herkl ne 'CA'.
i_output-herkl = c_for.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
move i_data4-fkimg to i_output-quantity.
if i_data3-fkart eq c_rep.
read table t_dord with key vbeln = i_data4-vbeln
posnn = i_data4-posnr.
if sy-subrc eq 0.
read table t_sord with key vbeln = t_dord-vbelv
posnn = t_dord-posnv.
if sy-subrc eq 0.
read table t_hord with key vbeln = t_sord-vbelv
posnr = t_sord-posnv.
if sy-subrc eq 0.
read table t_ford with key vbeln = t_hord-vbeln
posnr = t_hord-uepos.
if sy-subrc eq 0.
read table i_price with key vbeln = t_ford-vbeln
posnr = t_ford-posnr.
if sy-subrc eq 0.
read table i_price1 with key knumv = i_price-knumv
kposn = t_ford-posnr.
if sy-subrc eq 0.
if i_price1-kpein ne 0.
i_output-value =
( i_price1-kbetr / i_price1-kpein ) *
i_data4-fkimg.
endif.
endif.
endif.
endif.
endif.
endif.
endif.
else.
move i_data4-grwrt to i_output-value.
endif.
append i_output.
clear i_output.
clear : i_data5, i_data6.
endif.
endloop.
endloop.
sort i_output by verld herkl bezei stawn.
endform.
FORM DISPLAY_OUTPUT *
This form is to create the ALV output
form display_output.
data: xevents type slis_t_event,
ls_event type slis_alv_event,
slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
slis_ev_end_of_list type slis_formname value 'END_OF_LIST'.
*Call Function 'REUSE_ALV_EVENTS' for top of page
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = xevents
EXCEPTIONS
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
read table xevents with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move slis_ev_top_of_page to ls_event-form.
append ls_event to xevents.
endif.
read table xevents with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move slis_ev_end_of_list to ls_event-form.
append ls_event to xevents.
endif.
if r_dets ne space.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BELNR'.
l_fieldcat-seltext_m = text-912.
l_fieldcat-seltext_l = text-912.
l_fieldcat-reptext_ddic = text-912.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '12'..
when 'POSNR'.
l_fieldcat-seltext_m = text-913.
l_fieldcat-seltext_l = text-913.
l_fieldcat-reptext_ddic = text-913.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '6'.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
is_layout = t_layout
i_save = 'A'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = i_output
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
else. " MAHEEDHAR
ELSEIF R_SUMM EQ 'X'. " MAHEEDHAR
sort i_output by verld herkl stawn bezei.
loop at i_output.
move-corresponding i_output to t_outsum.
collect t_outsum.
endloop.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'T_OUTSUM'
i_inclname = 'ZVRA0001FTB13'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-col_pos = '8'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
i_save = 'A'
is_layout = t_layout
i_default = 'X'
is_variant = variante
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = t_outsum
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
MAHEEDHAR-START.
*"-- if detail summary checkbox is selected
elseIF R_MSSNG = 'X'.
PERFORM PREPARE_HEADER.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
hi,
*& Report ZALV_FIELD_GRID1
REPORT ZALV_FIELD_GRID1
NO STANDARD PAGE HEADING.
TABLES MARA.
type-pools :slis.
TYPES : BEGIN OF TMARA ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
ERSDA LIKE MARA-ERSDA,
color(4) type c,
SEL type c,
LIGHT TYPE C,
END OF TMARA.
TYPES: BEGIN OF TMAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
SEL TYPE C,
COLOR(4),
END OF TMAKT.
DATA: ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
wa_fieldcat type slis_fieldcat_alv,
fieldcat type slis_fieldcat_alv occurs 0,
i_layout type slis_layout_alv,
WA_LISTHEADER TYPE SLIS_LISTHEADER ,
i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
V_EVENTS TYPE SLIS_T_EVENT ,
WA_EVENT TYPE SLIS_ALV_EVENT,
I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
PRINT_CONT type slis_print_alv.
SELECTION SCREE
selection-screen begin of block screen1 with frame title TEXT-001.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /32(35) COMM1.
SELECTION-SCREEN ULINE /27(35).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS MATNR FOR MARA-MATNR.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /30(50) COMM2.
SELECTION-SCREEN ULINE /27(40).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN SKIP.
selection-screen end of block screen1.
INITIALIZATION
INITIALIZATION.
MATNR-low = '23'.
MATNR-high = '1000'.
MATNR-option = 'BT'.
MATNR-sign = 'I'.
APPEND MATNR.
ERSDA-low = '20030124'.
ERSDA-high = '20050302' .
APPEND ERSDA.
PERFORM FILLFIELD.
PERFORM FILLLAYOUT.
PERFORM build_print_params.
PERFORM FILL_SORT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
comm1 ='SELECT MATERIAL NUMBER RANGE'.
comm2 ='SELECT MATERIAL CREATION DATE'.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM READDATA.
PERFORM POPDATA.
*& Form READDATA
text
FORM READDATA .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-LOW
IMPORTING
OUTPUT = MATNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-HIGH
IMPORTING
OUTPUT = MATNR-HIGH.
SELECT MATNR
ERSDA
MEINS
FROM MARA
INTO CORRESPONDING FIELDS OF
TABLE ITAB
WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
LOOP AT ITAB.
data id_color type i VALUE 1.
data id_colors(2) type c.
IF ITAB-MATNR < '000000000000000100'.
ITAB-LIGHT = '1'.
ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
'000000000000000100' .
ITAB-LIGHT = '2'.
ELSE.
ITAB-LIGHT = '3'.
ENDIF.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab-color.
modify itab.
CLEAR ITAB.
endloop.
ENDFORM. " READDATA
Form FILLFIELD
FORM FILLFIELD .
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-outputlen = 20.
WA_FIELDCAT-HOTSPOT = 'X'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
*WA_FIELDCAT-EMPHASIZE = 'C210'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-COL_POS = '2'.
*WA_FIELDCAT-EMPHASIZE = 'C510'.
WA_FIELDCAT-outputlen = 10.
wa_fieldcat-seltext_m = 'UNIT'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'ERSDA'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-outputlen = 15.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
*WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'CREAT DATE'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. "FILLFIELD
Setup print parameters
form build_print_params.
PRINT_CONT-reserve_lines = '3'. "Lines reserved for footer
PRINT_CONT-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
Form POPDATA
FORM POPDATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOPPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_MARA
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_EVENTS
IT_EVENT_EXIT =
IS_PRINT = PRINT_CONT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " POPDATA
Form TOPPAGE
FORM TOPPAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "TOPPAGE
Form FILLLAYOUT
FORM FILLLAYOUT .
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-lights_fieldname = 'LIGHT'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
I_LAYOUT-no_totalline = 'X'.
ENDFORM. "FILLLAYOUT
Form FILL_SORT
FORM FILL_SORT .
SORT-DOWN = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'MATNR'.
SORT-tabname = 'MARA'.
APPEND SORT.
ENDFORM. " FILL_SORT
Form EVENT_CALL
FORM EVENT_CALL .
DATA: I_EVENT LIKE V_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " EVENT_CALL
Form POPULATE_EVENT
FORM POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
move 'END_OF_PAGE' to WA_EVENT-FORM.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
endif.
ENDIF.
ENDFORM. "POPULATE_EVENT
FORM END_OF_PAGE.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
ENDFORM.
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
when 'MATNR'.
read table itab with key matnr = RS_SELFIELD-VALUE.
if sy-subrc = 0.
PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
PERFORM BUILD_FIELDCATLOG_MAKT.
PERFORM FILLLAYOUT_MAKT.
PERFORM DISPLAY_ALV_MAKT.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
Form DATA_RETRIEVAL_MAKT
FORM DATA_RETRIEVAL_MAKT USING TMATNR .
SELECT MATNR
MAKTX
MAKTG
UP TO 100 ROWS
FROM MAKT
INTO TABLE ITAB1
WHERE SPRAS = 'EN' AND MATNR = TMATNR.
LOOP AT ITAB1.
data id_color type i VALUE 1.
data id_colors(2) type c.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab1-color.
modify itab1.
CLEAR ITAB1.
ENDLOOP.
ENDFORM. "DATA_RETRIEVAL_MAKT
Form FILLLAYOUT_MAKT
FORM FILLLAYOUT_MAKT .
CLEAR I_LAYOUT.
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
ENDFORM. " LAYOUT_MAKT
Form BUILD_FIELDCATLOG_MAKT
FORM BUILD_FIELDCATLOG_MAKT .
REFRESH FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
WA_FIELDCAT-EMPHASIZE = 'C510'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTX'.
WA_FIELDCAT-COL_POS = '2'.
WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTG'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-EMPHASIZE = 'C210'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG_MAKT
Form DISPLAY_ALV_MAKT
FORM TOP-OF-PAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB1 lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "TOP-OF-PAGE
*& Form DISPLAY_ALV_MAKT
text
FORM DISPLAY_ALV_MAKT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = I_TITLE_MAKT
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_MAKT
Regards
Ashok kumar -
Production orders not to be considered during MRP run
Dear SAPeers,
i want to know how to ensure that open production orders are not considered during the MRP run.
the following is the scenario.
PIR for march after MRP run creates a planned order. this planned order is converted to production order. now this production order is processed but not completely confirmed and TECOed after a certain quantity has been produced.
now we delete the old PIR and create a new PIR in the next month. now we revoke the TECO status of the production order and run MRP. I want to know how to avoid MRP from considering the open production order and create planned order for the complete PIR quantity.
Thanks and Regards
SrinivasanSrini,
what i am worried is shortfall of raw materials in case they were to open the production order in the current month after the planning has been done. how do we allocate raw materials for both the plan as well as the open production order?
Okay, you presumably had RM available for all of your production orders (and those RM were balanced by the reservations from the production orders). Now, you TECO the production order. In effect, any un-issued RM are now released and freely available for other orders/planned orders. Now you plan the following month. Those RM that were freed can and will be used for the new plan. Odd business process, but OK. Now, you re-open the production orders, and, yes, you will have a shortage unless you run RM MRP again. This is, ah, inconsistent with any business process I have ever seen.
The question that jumps to mind is, "Why re-open the old production orders at all? Alternatively, why were they TECOd in the first place?" If one knows that he intends to complete an order in production, one does not normally TECO the order, and then later reverse the TECO.
With respect to my name, I must unfortunately keep a low profile. Ever since I escaped from the mental institution, the thought-police have been hunting for me. I do not wish to be the recipient of any further electroshock 'treatments'.
Rgds,
DB49 -
BAPI_GOODSMVT_CREATE for production order,not update database
hi guru,
i am using BAPI_GOODSMVT_CREATE for production order.When i m testing this BAPI
at se37 it creates one mat doc no and i m not getting any return messages.Now i m
writing code for it at se38. but it does not update the database even though i used
bapi_transaction_commit. here sy-subrc = 0.bt when i m checking MSEG table showing
that mat doc no does not exists.
please help me out asap.
thanks and regurds,
manasiCHECK THIS CODE
REPORT ZBAPI_GOODSMVT_CREATE.
*DECLARING INTERNAL TABLE TO HOLD FILE DATA.
DATA: BEGIN OF itab OCCURS 0,
text(200),
END OF itab.
*DECLARING INTERNAL TABLE TO PASS FILE DATA.
TYPES: BEGIN OF tw_goodsmvt,
pstng_date TYPE budat,
doc_date TYPE bldat,
material TYPE matnr,
plant TYPE werks_d,
stge_loc TYPE lgort_d,
move_type TYPE bwart,
* entry_qnt TYPE erfmg,
costcenter TYPE kostl,
END OF tw_goodsmvt,
tt_goodsmvt TYPE STANDARD TABLE OF tw_goodsmvt.
DATA: lt_goodsmvt TYPE tt_goodsmvt,
lw_goodsmvt TYPE tw_goodsmvt.
*declaring internal table of bapi structure.
DATA:s_goodsmvt_header LIKE bapi2017_gm_head_01,
lt_goodsmvt_item TYPE STANDARD TABLE OF bapi2017_gm_item_create WITH HEADER LINE,
lt_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA:str_filename TYPE string,
gm_code TYPE gm_code,
v_head_count TYPE i VALUE 0,
v_prev_count TYPE i VALUE 1,
v_qnt TYPE string,
v_dummy.
*selection screen
SELECTION-SCREEN BEGIN OF BLOCK bk with frame title text_001.
PARAMETERS:p_docdat TYPE bldat,
p_pstdat TYPE budat,
fname LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK bk.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
*to provide F4 functionality.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
IMPORTING
file_name = fname.
* start of selection
START-OF-SELECTION.
str_filename = fname.
gm_code = '06'.
* to upload data
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = str_filename
filetype = 'ASC'
has_field_separator = 'X'
read_by_line = 'X'
TABLES
data_tab = itab.
*SPLITING DATA TO INTERNAL TABLES.
LOOP AT itab.
IF itab+0(1) EQ 'H'.
v_head_count = v_head_count + 1.
IF v_head_count GT v_prev_count.
PERFORM bapi_upload.
ENDIF.
SPLIT itab-text AT ',' INTO v_dummy
lw_goodsmvt-pstng_date
lw_goodsmvt-doc_date.
s_goodsmvt_header-doc_date = lw_goodsmvt-doc_date.
s_goodsmvt_header-pstng_date = lw_goodsmvt-pstng_date.
v_prev_count = v_head_count.
ELSEIF itab+0(1) EQ 'L'.
SPLIT itab-text AT ',' INTO v_dummy
lw_goodsmvt-material
lw_goodsmvt-plant
lw_goodsmvt-stge_loc
lw_goodsmvt-move_type
v_qnt
lw_goodsmvt-costcenter.
* PASSING DATA TO INTERNAL TABLE TYPE BAPI STRUCTURE.
lt_goodsmvt_item-material = lw_goodsmvt-material.
lt_goodsmvt_item-plant = lw_goodsmvt-plant.
lt_goodsmvt_item-stge_loc = lw_goodsmvt-stge_loc.
lt_goodsmvt_item-move_type = lw_goodsmvt-move_type.
lt_goodsmvt_item-entry_qnt = v_qnt.
lt_goodsmvt_item-costcenter = lw_goodsmvt-costcenter.
APPEND lt_goodsmvt_item.
ENDIF.
v_prev_count = v_head_count.
ENDLOOP.
PERFORM bapi_upload.
*& Form bapi_upload
form bapi_upload .
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = s_goodsmvt_header
goodsmvt_code = gm_code
* TESTRUN = ' '
* IMPORTING
* GOODSMVT_HEADRET =
* MATERIALDOCUMENT =
* MATDOCUMENTYEAR =
tables
goodsmvt_item = lt_goodsmvt_item
* GOODSMVT_SERIALNUMBER =
return = lt_return.
PERFORM commit_work TABLES lt_return.
CLEAR : lw_goodsmvt, s_goodsmvt_header.
REFRESH: lt_goodsmvt[], lt_goodsmvt_item[].
endform. " bapi_upload
*& Form commit_work
* text
* -->P_LT_RETURN text
form commit_work tables p_lt_return structure bapiret2.
IF NOT lt_return[] IS INITIAL.
*error handling
loop at lt_return.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = lt_return-id
LANG = sy-langu
NO = lt_return-NUMBER
V1 = lt_return-message_v1
V2 = lt_return-message_v2
V3 = lt_return-message_v3
V4 = lt_return-message_v4
IMPORTING
MSG = lt_return-MESSAGE
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
WRITE: lt_return-id, lt_return-message, lt_return-message_v1, lt_return-message_v2,
lt_return-message_v3, lt_return-message_v4.
CLEAR lt_return.
ENDLOOP.
ELSE.
* commit work
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
RETURN = lt_return.
WRITE: lt_return-id, lt_return-message, lt_return-message_v1, lt_return-message_v2,
lt_return-message_v3, lt_return-message_v4.
CLEAR lt_return.
endif.
endform. " commit_work -
Production order not settle correctly
Hello Guru,
PO70 in the closing steps showing the balance of production jobs that settled in the current month. Normally the account holds hundreds of records for thousands of dollars. February close had approximately 10 records for $.05.
1. How Can I check to make sure the settlement is working properly into account 5049000 which is Production Variance Clearing Account?
2. We had 5000 production orders settled in September, 2013 and only 1500 settle in February, 2014. What could have caused this? How can I reslove and go about this issue?
Thank you.Hi Adelkunle
While running variance cycle or settling the production orders, are you getting any error messages. Check the logs.
Also from business point of view and also based on status of the active production orders, it is quite possible to have low number of production orders settling to variances, in the current period. I do not see any technical issues in this, unless I have no complete understanding of your issue, in which case, I wish if you can please elaborate more on the issue, on technical side.
Regards
Mustafa -
FF7b liquidity analysis - blocked SD orders not coming through
Hi,
our business wants to see also blocked orders. Currently they are not displayed in FF7b.
Is there a way to achieve this?
Regards
HeinI have an error where the *Total Actual Costs* for a Process order is not pulling through.
When I go into *Costs* -> *Analysis* I see that the *Total Target Costs* are coming through correctly, but the
*Total Actual Costs* are not coming through, there are no values.
The material has all the relevant pricing correctly in place.
These orders all have the correct *goods issues/receipts* done, as well as all the confirmations on the
*PI Sheets* are done correctly, but still no *Total Actual Costs* are coming through.
Please advise if there is something incorrect in the costing setup, master recipe setup or BOM setup.
Process orders for other materials all work correctly, however only this material does not pull through
*Total Actual Costs*
Dear,
please check the material document of GI and GR- In that document, the material as any value?
If yes revert me, check the settlement rule for that order in co02 -
SAP Production order not closed, what are the negative effects
Hi there,
We are not closing the production orders. What would be the negative effects ? The orders are delivered, costed and Technically complete and all the teams are happy and no one is complaining. I also know we would need to close the production orders. But what is the effect of not closing the orders. Any thoughts ?
thanksHello
Similar qustions have been already asked in the past. Please read the threads below to understand exactly what happens when closing a production order:
closing production orders
completion of a production order
BR
Caetano -
Component allocation in production order not match that in routing
Hi
My problem is that the operation allocated to a component in production order does not match that assigned in routing. For example, component A in the routing (CA03, tab CompAlloc) is allocated to operation 0050, but when we convert a planned order to a production order, component A got allocated to a different operation, say 0020. I have no idea how that happened. Can anyone help?
Thanks,
Lin-Lin LiLin,
One possibility might be, you might be having multiple BOMs for that FG.
The alternative which is assigned in the routing might be different from the alternative read in the order.
Check & revert.
Hope this helps you.
SmanS -
GR for Production order not possible with settlement receiver as IO
Hi
I have created a production order and the settlement rule is to an internal order. But it does not allow me to do goods receipt. Pl tell me what to do.
Thanks
kamalaHi,
SAP recommands production order settlment to be beow object and additional CO Object COPA.
Settlement Receivers Depending on the Scenario
1.Make-to-stock production >>The make-to-stock inventory (receiver = material) >> COPA
2.Sales-order-related production with a valuated sales order stock>>The valuated sales order stock (receiver = material)>>COPA
3. Sales-order-related production with a nonvaluated sales order stock>>The sales order item (receiver = sales order)>>COPA
The scenario you are trying is doesn't fit into standard SAP framework for production order so please try said scenario with CO production order. Again CO production orders mostly recommondable without PP so figure out impact on cross modules.
Regards,Ashok. -
GR for Production Order, not updating Stock
Hi All,
Issue:
I am posting a GR for a production order, but the stock qty is not getting updated. I checked in MB51, i find the document being posted, but in MMBE the stock is not updated. In the system, there is 2 settlement profiles, one which allows settlement on material & the other only on G/L or Cost Center. I find this issue only when i create orders which have settlement receivers as G/L or Cost Center, also in MB51 i find that the sloc field is blank, even though it is maintained in the order & the same is seen when i receive via MB31.
Await your inputs as to where i need to check to resolve this issue.
Regards,
VivekHi Prasobh,
I believe your pointing in the right direction. My suspicion is on similar lines.
A brief backdrop:
Order is created, whose settlement is to be done on a G/L acct, the settlement profile does not allow settlement onto material & hence in the GR tab, the GR non-valuated indicator is ticked. I manually ticked the GR indicator to post GR via MB31.
In MB51 i find the material document, but what is interesting is, the storage location field is blank, even though the order contains this value, which was later seen during MB31 posting as well.
But a similar order has been created in the legacy system with the same parameters as above & i find the stock to be updated.
So i suspect, it is something to do with the account determination, which is not allowing the quantity updation to take place, because of the GR non-valuated tick in the order header.
Hope i was able to put across the issue to you in a clear way.
Regards,
Vivek
Maybe you are looking for
-
How do I repeat loop a video file from iPod Touch to Apple TV ?
I have an iPod Touch that is a few years old but running the latest software update. I want to loop a video to then play through Apple TV onto 2 panels at the front of our shop. I have saved the file as a video and Music Video (using Get Info etc)
-
In Apple Mail, how can I maintaining Mailbox links when migrating hosting?
First, I apologize if this question has already been asked and answered. If so, please kindly point me to the appropriate discussion. I'm in the process of changing hosting for one of my (several) websites and email addresses. I have been using App
-
We have a COM application that is installed on hundreds of machines around the country. We have instructions included in our install doc of how to set up DCOMCnfg. On one machine in the field and one machine in our lab (both happen to be Windows 7
-
The new features avilable in webdynpro for abap with EHP5
Hi, Currently our ECC 6.0 is upgraded with EHP5 from EHP3. Could anyboy tell me the new featues available in webdynpro for abap for this EHP5. If i develop WDA objects in EHP3 environment and transport it to new system with EHP5 . What would be the
-
Lots of problems with 10.9.2 upgrade
How do I fix all of these problems: Upgraded today to 10.9.2 - No sound no sound device sound internally or externally. Sound comes at startup before operating system is loaded so I am assuming it's an OSX issue ` No Flash video All I get are blac