Po with sheduling aggriment
hi sap gurus
can we creat po with refrence sheduluing aggriment,
if yes ,then how
because in po in document overview (selections varient) thire is sheduling option .whats use of that pls tell me
regards
Hi Asma
I hope u understand that a sheduling agreemnet is a kind of a po so in the doc overview of the po key in the scheduling agreemnet number against po and click other po and see if u can view the SA.
It should be fine.
Similar Messages
-
Problem with sheduler (DBMS_JOB)
Hi All,
I have scheduled one procedure through dbms_job
when i use the query,
exec dbms_job.run(142);
i got the following output
select LAST_DATE,LAST_SEC, THIS_DATE,THIS_SEC,NEXT_DATE,NEXT_SEC from user_jobs where job=141;
LAST_DATE LAST_SEC THIS_DATE THIS_SEC NEXT_DATE NEXT_SEC
18-DEC-07 18:17:19 18-DEC-07 18:22:19
after 5 mins i issued the same query
i have got the same output.
What is the problem ? whether the scheduler is working?if yes then why is not sheduling?
please help me...................Hi,
>>what could be the problem?
You must connect using a privileged user .... with DBA privileges.
SQL> connect scott/tiger
Connected.
SQL> show parameter job
ORA-00942: table or view does not exist
SQL> connect / as sysdba
Connected
SQL> show parameter job
NAME TYPE VALUE
job_queue_processes integer 10Cheers
Legatti -
[BO XI 3.1] Error with char/varchar with MySQL
We are using Business Objects with a MySQL database underneath. The ODBC driver installed on the Business Objects server is configured as shown below:
[BIRDDBD1]
Description = BIRDDBD1
Driver = MySQL
SERVER = xx.xx.xx.xx
USER = xxxxx
PASSWORD = xxxxx
PORT = 3306
DATABASE = IAS
Option = 3
The users use InfoView to create Web Intelligence reports. As soon as at least one attribute of datatype char or varchar is contained in a report, we get the following error message:
A database error occured. The database error text is: [MySQL][ODBC 3.51 Driver][mysqld-5.1.31sp1-enterprise-gpl-advanced-log]Restricted data type attribute violation. (WIS 10901)
When a report solely contains number and date attributes, we get a proper report result and do not get any error message.
Trying to get data (also char or varchar data!) within the Business Objects Designer does not cause any problems!
Could you please advice?
MartinHi,
this can be. There are some changes in the Permissions from Rel.2 to XI 3.x
I know that under 3.0 there was a Bug with Sheduling Permissions. Do you have any FixPack applied for your 3.0 Installation ?
BTW: I would recommend upgrading to 3.1 SP2 (latest version). There are a lot of Bugs in 3.0
Regards
-Seb. -
hello dear,
how can i calculate total from a fields to get value,i am using table bset and i have to calculate total of fields fwste in according to hkont and belnr to get exice amount please refer some related programs.If you want to calculate th e third filed based on other two, you would need to do it programatically using control break statements like AT NEW / AT END OF ect ..
Below is sample program which does summary based on mrp controllers and other parameeters.
Modification Log
Program Name:ZCD0R_PDC_PERCENT_FILL
Author:Santosh Sarda
Date Written:7/19/2007
Request #:CDXK961051
Requested by:Blanca Ramirez.
Description: Get the percent fill of PDC Service Parts Requirements
Program Specifications:Service Store Percent Fill
Mod date Programmer Reference Description
REPORT zcd0r_pdc_percent_fill.
Includes
types
tables
types
internal tables
Work Areas
internal data fields
Internal table for field catalogue
Internal table for sort and sum
Structure for layout control settings
Structure for sort and Sum
Parameters and Selection Options
Initialization
at selection screen
event Start of Selection
Get ReQuired Data
Calculate % FILL MRP Controllerwise.
Calculate % Fill material wise.
forms
---- This Subroutine does not take any parameters.
*07/19/2007 Santosh S. CDXK961051 Initial Creation
*08/01/2007 Santosh S. CDXK961295 Layout change
*eject
TYPE-POOLS : slis.
Select data as per selection screen conditions .
TABLES:vbep, " Sales Document: Schedule Line Data
vbap, " Sales Document: Item Data
vbak, " Sales Document: Header Data
marc. " Plant Data for Material
This Subroutine does not take any parameters.
TYPES:
BEGIN OF t_vbak,
vbeln TYPE vbak-vbeln, "Sales document
kunnr TYPE vbak-kunnr, "Sold-to party
END OF t_vbak,
BEGIN OF t_vbap,
vbeln TYPE vbap-vbeln, "Sales document
posnr TYPE vbap-posnr, "Item
werks TYPE vbap-werks, "Plant
matnr TYPE vbap-matnr, "Material
END OF t_vbap,
BEGIN OF t_marc,
werks TYPE marc-werks, "Plant
matnr TYPE marc-matnr, "Material
dispo TYPE marc-dispo, "MRP Controller
END OF t_marc,
BEGIN OF t_makt,
matnr TYPE makt-matnr, "Material
maktx TYPE makt-maktx, "Material Description
END OF t_makt,
BEGIN OF t_vbpa,
vbeln TYPE vbpa-vbeln, "Sales document
parvw TYPE vbpa-parvw, "Partner Function
kunnr TYPE vbpa-kunnr, "Ship To Party
END OF t_vbpa,
BEGIN OF t_t024d,
werks TYPE t024d-werks, "Plant
dispo TYPE t024d-dispo, "MRP Controller
dsnam TYPE t024d-dsnam, "Controller Name
END OF t_t024d,
BEGIN OF t_vbep,
vbeln TYPE vbep-vbeln, "Sales document
posnr TYPE vbep-posnr, "Item
etenr TYPE vbep-etenr, "Schedule line
edatu TYPE vbep-edatu, "Delivery Date
wmeng TYPE vbep-wmeng, "Order quantity
END OF t_vbep,
BEGIN OF t_vbep_all,
vbeln TYPE vbep-vbeln, "Sales document
posnr TYPE vbep-posnr, "Item
etenr TYPE vbep-etenr, "Schedule line
matnr TYPE marc-matnr, "Material
maktx TYPE makt-maktx, "Material Description
dispo TYPE t024d-dispo, "MRP Controller
dsnam TYPE t024d-dsnam, "Controller Name
edatu TYPE vbep-edatu, "Delivery Date
wmeng TYPE vbep-wmeng, "Order Quantity
olfmng TYPE olfmng, "Open Quantity
soldto TYPE vbak-kunnr, "Sold To Party
shipto TYPE vbpa-kunnr, "Ship To Party
END OF t_vbep_all,
BEGIN OF t_marc_all,
werks TYPE marc-werks, "Plant
matnr TYPE marc-matnr, "Material
dispo TYPE marc-dispo, "MRP Controller
maktx TYPE makt-maktx, "Material Description
dsnam TYPE t024d-dsnam, "Controller Name
END OF t_marc_all,
BEGIN OF t_output,
dispo TYPE marc-dispo, "MRP Controller
dsnam TYPE t024d-dsnam, "Controller Name
matnr TYPE vbap-matnr, "Material
maktx TYPE makt-maktx, "Material Description
vbeln TYPE vbak-vbeln, "Sales document
posnr TYPE vbap-posnr, "Item
edatu TYPE vbep-edatu, "Delivery Date
wmeng TYPE i, "Order Quantity
shipqty TYPE i, "Shipped Quantity
olfmng TYPE i, "Open Quantity
fill TYPE olfmng, "%Fill
materialfill TYPE olfmng,
controllerfill TYPE olfmng,
soldto TYPE vbak-kunnr, "Sold To Party
shipto TYPE vbpa-kunnr, "Ship To Party
END OF t_output,
BEGIN OF t_date,
edatu TYPE sy-datum, "Delivery date
END OF t_date.
******************* Do Nothing
Do Nothing
Do Nothing
Do Nothing
Begin Of CDXK961295********************************
TYPES:BEGIN OF t_sum_mrpcontro,
dispo TYPE marc-dispo, "MRP Controller
dsnam TYPE t024d-dsnam, "Controller Name
wmeng TYPE i, "Order Quantity
shipqty TYPE i, "Shipped Quantity
olfmng TYPE i, "Open Quantity
controllerfill TYPE olfmng,
END OF t_sum_mrpcontro,
BEGIN OF t_sum_material,
dispo TYPE marc-dispo, "MRP Controller
dsnam TYPE t024d-dsnam, "Controller Name
matnr TYPE vbap-matnr, "Material
maktx TYPE makt-maktx, "Material Description
wmeng TYPE i, "Order Quantity
shipqty TYPE i, "Shipped Quantity
olfmng TYPE i, "Open Quantity
materialfill TYPE olfmng,
END OF t_sum_material.
*******************Get Data from VBEP: schedule line data within Date range of EDATU.
End Of CDXK961295 This Subroutine does not take any parameters.
Do Nothing .
DATA:
i_vbak TYPE STANDARD TABLE OF t_vbak,
i_vbap TYPE STANDARD TABLE OF t_vbap,
i_marc TYPE STANDARD TABLE OF t_marc,
i_makt TYPE STANDARD TABLE OF t_makt,
i_vbpa TYPE STANDARD TABLE OF t_vbpa,
i_t024d TYPE STANDARD TABLE OF t_t024d,
i_vbep TYPE STANDARD TABLE OF t_vbep,
i_vbep_all TYPE STANDARD TABLE OF t_vbep_all,
i_marc_all TYPE STANDARD TABLE OF t_marc_all,
o_output TYPE STANDARD TABLE OF t_output,
i_date TYPE STANDARD TABLE OF t_date,
i_sum_mrpcontro TYPE STANDARD TABLE OF t_sum_mrpcontro,"CDXK961295
i_sum_material TYPE STANDARD TABLE OF t_sum_material. "CDXK961295
DATA:
wa_vbak LIKE LINE OF i_vbak,
wa_vbap LIKE LINE OF i_vbap,
wa_marc LIKE LINE OF i_marc,
wa_makt LIKE LINE OF i_makt,
wa_vbpa LIKE LINE OF i_vbpa,
wa_t024d LIKE LINE OF i_t024d,
wa_vbep LIKE LINE OF i_vbep,
wa_vbep_all LIKE LINE OF i_vbep_all,
wa_marc_all LIKE LINE OF i_marc_all,
wa_output LIKE LINE OF o_output,
wa_date LIKE LINE OF i_date,
wa_sum_mrpcontro LIKE LINE OF i_sum_mrpcontro, "CDXK961295
wa_sum_material LIKE LINE OF i_sum_material. "CDXK961295
Process material and mrp controller data.
CONSTANTS:
c_spras(2) TYPE c VALUE 'EN', "To get material Description In EN
c_parvw(2) TYPE c VALUE 'WE', "To get Ship to party ( SH=WE )
c_act_auth_03 LIKE tactz-actvt VALUE '03', "03 --> Plant check
c_x TYPE c VALUE 'X', "Field catelogue
c_c TYPE c value 'C'. "field catelogue
DATA: g_date TYPE sy-datum, "To keep track of delivery date
g_totalopen TYPE olfmng, "To Split OLFMNG in given date range
g_tabix TYPE sy-tabix. "To keep loop track
*Declartion of t_code for authority check.
DATA: g_tcode LIKE sy-tcode. "variable for TCODE.
************************** This Subroutine does not take any parameters.
ALVObject**********************************
DATA:
i_fieldcat TYPE slis_t_fieldcat_alv,
Process VBEP data with material data.
i_sort TYPE slis_t_sortinfo_alv,
This Subroutine does not take any parameters.
fs_layout TYPE slis_layout_alv,
fs_sort LIKE LINE OF i_sort ,
*internal table to set pf status
i_extab TYPE standard table of slis_extab.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:
s_werks FOR marc-werks OBLIGATORY, " Producing Plant
s_matnr FOR marc-matnr, " Material
s_dispo FOR marc-dispo. " MRP Controller
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECT-OPTIONS:
s_vkorg FOR vbak-vkorg , " Sales Organisation
s_vbeln FOR vbak-vbeln , " Sales Order
s_auart FOR vbak-auart DEFAULT 'ZLCW' TO 'ZLIF', " Sales Doc Type
s_lgort FOR vbap-lgort, " Storage Location
s_kunnr FOR vbak-kunnr DEFAULT '99999PDY00', " Sold to party
s_edatu FOR vbep-edatu OBLIGATORY. " Delivery Date
SELECTION-SCREEN END OF BLOCK blk2.
**********************This subroutine is copied from transaction ZCSRS to get open quantity.
Naming Conventions have been changed as per standards.
BEGIN OF CDXK961295 This Subroutine does not take any parameters.
*To add select radiobutton group for choosing layout as per users
*requirement to see detail or summary.
SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME TITLE text-026.
PARAMETER r_lay1 RADIOBUTTON GROUP r1.
PARAMETER r_lay2 RADIOBUTTON GROUP r1 DEFAULT 'X'.
PARAMETER r_lay3 RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK blk3.
**********************Consider only Sch Agmts here to proceed further
CHECK NOT t_sch_agmts[] IS INITIAL.
Doc Flow entries from VBFA
Sales Document: Item Status from VBUP
Sch Line items from VBEP
Sch Agmt Items from VBAP
Now, use the FM for each line item and get the open qty. Make a copy
of iT_SCH_AGMTS for use later on.
Call the FM now
END OF CDXK961295*****************************
To populate final output table
INITIALIZATION.
PERFORM t_code_check.
This Subroutine does not take any parameters.
*Check Authorisation For Plant.
AT SELECTION-SCREEN ON s_werks.
PERFORM plant_auth_check.
*Validate MRP Controller.
AT SELECTION-SCREEN ON s_dispo.
PERFORM validate_mrp_controller.
*Validate Document type.
AT SELECTION-SCREEN ON s_auart.
PERFORM validate_doc_type.
if s_edatu-high value is enterd by user
if only s_edatu-low value is enterd by user
sort for getting orders with shedule lines in reverse order TO adjust
open quantity as per earliest delivery date.
START-OF-SELECTION.
*Check Delivery Dates Entered By user and MODIFY the same.
PERFORM chk_del_date.
PERFORM get_data.
*Loop To Process Number Of Single Values Entered Of EDATU.
LOOP AT s_edatu .
g_tabix = sy-tabix.
READ TABLE i_date INTO wa_date INDEX g_tabix.
IF sy-subrc = 0.
g_date = wa_date-edatu.
PERFORM get_vbep_data. "Get Data from VBEP
PERFORM process_material_data. "Material Detail
PERFORM process_data. "Process Data
PERFORM get_rem_quantity. "Get Open Qty From FM
PERFORM get_final_output. "Add data to output table
CLEAR: i_vbep[],i_vbep_all[].
ENDIF. " IF SY-SUBRC = 0.
ENDLOOP. " LOOP AT s_edatu .
**********************To Calculate TOTAL % fill MRP ControllerWise
BEGIN OF CDXK961295 This subroutine does not take any parameters.
*Display alv as per layout selection.
IF r_lay1 = 'X'.
PERFORM calc_mrpcontroller_%fill.
PERFORM calc_material_%fill.
PERFORM fill_catalogue. " Fill catelogue
PERFORM display_output. " Display OUTPUT ON AlV GRID using FM.
ELSEIF r_lay2 = 'X'.
PERFORM process_sum_mrpcontro.
PERFORM fill_catelogue_mrpcontro. " Fill catelogue
PERFORM display_sum_mrpcontro. " Display OUTPUT ON AlV GRID using FM
ELSEIF r_lay3 = 'X'.
PERFORM process_sum_material.
PERFORM fill_catelogue_material. " Fill catelogue
PERFORM display_sum_material. " Display OUTPUT ON AlV GRID using FM.
ENDIF. " IF r_lay1 = 'X'.
**********************END OF CDXK961295 This subroutine does not take any parameter.
&---- To fill FieldCatelogue to be passed to FM
*& Form chk_del_date
This Subroutine does not take any parameters.
&----To sort output on MRP Controller AND Material and do subtotal.
Sort on controller name ,material description to get
displayed controller name and material description along with mrp
controller and material at subtotals level.
*check if delivery date is less than today,then modify date till today
*else search in given range.
---- Call alv display function module
This Subroutine does not take any parameters.
SORT AS per MRP Controller,Material and delete duplicates.
Set the Layout attributes
Call FUNCTION MODULE FOR DISPLAY
DO NOTHING
----FORM chk_del_date.
LOOP AT s_edatu.
wa_date = s_edatu-high.
IF s_edatu-low LT sy-datum AND s_edatu-high LT sy-datum.
s_edatu-high = sy-datum.
s_edatu-option = 'BT'.
MODIFY s_edatu.
ENDIF. "IF s_edatu-low LT sy-datum AND s_edatu-high LT sy-datum.
APPEND wa_date TO i_date.
CLEAR:wa_date.
ENDLOOP. " LOOP AT s_edatu.
ENDFORM. " chk_del_date
Check authorization against transaction code
&---- This subroutine does not take any parameters.
*& Form get_data
Validate Document type.
This subroutine does not take any parameters.
Authorisation and validation of Plant
---- This subroutine does not take any parameters.
FORM get_data.
*Get data from VBAK SD agreement and Sold To Party
SELECT vbeln
kunnr
FROM vbak
INTO TABLE i_vbak
WHERE vbeln IN s_vbeln
AND kunnr IN s_kunnr
AND auart IN s_auart
AND vkorg IN s_vkorg.
IF sy-subrc = 0.
SORT i_vbak BY vbeln.
ELSE.
MESSAGE e208(00) WITH 'No Scheduling Agreements Found '(003).
ENDIF. " IF SY-SUBRC = 0.
*Get data from VBAP item data and related material for SD Agrrement from
*VBAK
IF NOT i_vbak[] IS INITIAL.
SELECT vbeln
posnr
werks
matnr
FROM vbap
INTO TABLE i_vbap
FOR ALL ENTRIES IN i_vbak
WHERE vbeln EQ i_vbak-vbeln
AND werks IN s_werks
AND matnr IN s_matnr
AND lgort IN s_lgort
AND abgru EQ space.
IF sy-subrc = 0.
SORT i_vbap BY vbeln posnr.
ELSE.
MESSAGE e368(00) WITH
'No SD Agreements Found for Plant'(004) s_werks.
ENDIF. " IF SY-SUBRC = 0
ENDIF. "IF NOT i_vbak[] IS INITIAL
IF NOT i_vbap[] IS INITIAL.
*Get data from MARC material and MRP Controller for given PLANT.
SELECT werks
matnr
dispo
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN i_vbap
WHERE werks EQ i_vbap-werks
AND matnr EQ i_vbap-matnr
AND dispo IN s_dispo.
IF sy-subrc = 0.
SORT i_marc BY werks matnr.
ELSE.
Validation for PlantSELECT SINGLE WERKS
ENDIF. " IF SY-SUBRC = 0.
*To DELETE Entries from VBAP AS per dispo from select option .
LOOP AT i_vbap INTO wa_vbap.
READ TABLE i_marc INTO wa_marc WITH KEY werks = wa_vbap-werks
matnr = wa_vbap-matnr BINARY SEARCH.
IF sy-subrc <> 0.
DELETE i_vbap.
CONTINUE.
ENDIF. " IF SY-SUBRC <> 0.
ENDLOOP. " LOOP AT i_vbap INTO wa_vbap.
*Get Ship To Party FROM VBPA.
SELECT vbeln
parvw
kunnr
FROM vbpa
INTO TABLE i_vbpa
FOR ALL ENTRIES IN i_vbap
WHERE vbeln EQ i_vbap-vbeln
AND parvw EQ c_parvw.
IF sy-subrc = 0.
SORT i_vbpa BY vbeln.
DELETE ADJACENT DUPLICATES FROM i_vbpa COMPARING vbeln.
ELSE.
ENDIF. " IF SY-SUBRC = 0.
ENDIF. " IF i_vbap[] IS INITIAL
IF NOT i_marc[] IS INITIAL.
*Get Material Description in English from MAKT.
SELECT matnr
maktx
FROM makt
INTO TABLE i_makt
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND spras = c_spras.
IF sy-subrc = 0 .
SORT i_makt BY matnr.
DELETE ADJACENT DUPLICATES FROM i_makt COMPARING matnr.
ELSE.
Validate MRP Controller
ENDIF. " IF SY-SUBRC = 0 .
*Get MRP Controller Name from T024D.
SELECT werks
dispo
dsnam
FROM t024d
INTO TABLE i_t024d
FOR ALL ENTRIES IN i_marc
WHERE werks EQ i_marc-werks
AND dispo EQ i_marc-dispo.
IF sy-subrc = 0 .
SORT i_t024d BY werks dispo.
ELSE.
This subroutine does not take any parameters.
ENDIF. " IF SY-SUBRC = 0 .
ENDIF. " IF NOT i_marc[] IS INITIAL
ENDFORM. " get_data
*& Form get_vbep_data
&----Display summary by MRP Controller
This subroutine does not take any parameter.
Field Catelogue for summary by MRP Controller
This Subroutine doen not take any parameter
----FORM get_vbep_data.
IF NOT i_vbap[] IS INITIAL.
IF s_edatu-low GE sy-datum AND s_edatu-high IS INITIAL.
SELECT vbeln
posnr
etenr
edatu
wmeng
FROM vbep
INTO TABLE i_vbep
FOR ALL ENTRIES IN i_vbap
WHERE vbeln EQ i_vbap-vbeln
AND posnr EQ i_vbap-posnr
AND edatu EQ s_edatu-low.
ELSE.
SELECT vbeln
posnr
etenr
edatu
wmeng
FROM vbep
INTO TABLE i_vbep
FOR ALL ENTRIES IN i_vbap
WHERE vbeln = i_vbap-vbeln
AND posnr = i_vbap-posnr
AND edatu BETWEEN s_edatu-low and s_edatu-high.
ENDIF. "IF s_edatu-low GE sy-datum AND s_edatu-high IS INITIAL.
IF sy-subrc = 0 .
ELSE.
MESSAGE e208(00) WITH
'No Scheduling Agreements Found Within Given Delivery Date'(018).
ENDIF. " IF SY-SUBRC = 0 .
ENDIF. " i_vbap[] IS INITIAL.
ENDFORM. " get_vbep_data
Call alv display function module
&---- This Subroutine does not take any parameters.
*& Form process_material_data
SORT AS per MRP Controller and delete duplicates.
Do nothing
Set the Layout attributes
Call FUNCTION MODULE FOR DISPLAY
DO NOTHING
&---- This subRoutine calculates summary line by material and store in
internal table to display as in alv
this subroutine does not take any parameter.
Fills Field Catelogue for alv display for summary by material
---- This subRoutine does not take any parameter.
FORM process_material_data.
*To get Mterial Description and MRP Controller.
LOOP AT i_marc INTO wa_marc .
wa_marc_all-werks = wa_marc-werks.
wa_marc_all-matnr = wa_marc-matnr.
wa_marc_all-dispo = wa_marc-dispo.
READ TABLE i_t024d INTO wa_t024d WITH KEY werks = wa_marc-werks
dispo = wa_marc-dispo BINARY SEARCH.
IF sy-subrc = 0.
wa_marc_all-dsnam = wa_t024d-dsnam.
ENDIF. " IF SY-SUBRC = 0
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_marc-matnr
BINARY SEARCH.
IF sy-subrc = 0.
wa_marc_all-maktx = wa_makt-maktx.
ENDIF. " IF SY-SUBRC = 0.
APPEND wa_marc_all TO i_marc_all.
CLEAR :wa_marc_all,wa_marc,wa_t024d,wa_makt.
ENDLOOP. " i_marc INTO wa_marc
*Sort by palnt,material.
SORT i_marc_all BY werks matnr.
ENDFORM. " process_material_data
*& Form process_data
Call Function module For Display of summary my material.
&---- This SubRoutine Does not take any parameter.
SORT AS per MRP Controller,Material and delete duplicates.
do nothing.
Set the Layout attributes
Call FUNCTION MODULE FOR DISPLAY
DO NOTHING
---- Fills fieldcatelogue to be passed to ALV
p_output--> internal table for field catelogue type i_fieldcat.
FORM process_data.
*To get i-vbep_all
IF NOT i_vbep IS INITIAL.
LOOP AT i_vbep INTO wa_vbep.
wa_vbep_all-vbeln = wa_vbep-vbeln.
wa_vbep_all-posnr = wa_vbep-posnr.
wa_vbep_all-etenr = wa_vbep-etenr.
wa_vbep_all-edatu = wa_vbep-edatu.
wa_vbep_all-wmeng = wa_vbep-wmeng.
READ TABLE i_vbap INTO wa_vbap WITH KEY vbeln = wa_vbep-vbeln
posnr = wa_vbep-posnr BINARY SEARCH.
IF sy-subrc = 0.
wa_vbep_all-matnr = wa_vbap-matnr.
READ TABLE i_marc_all INTO wa_marc_all WITH KEY
werks = wa_vbap-werks matnr = wa_vbap-matnr BINARY SEARCH.
IF sy-subrc = 0.
wa_vbep_all-dispo = wa_marc_all-dispo.
wa_vbep_all-dsnam = wa_marc_all-dsnam.
wa_vbep_all-maktx = wa_marc_all-maktx.
ENDIF. " IF SY-SUBRC = 0.
ENDIF. " IF SY-SUBRC = 0.
READ TABLE i_vbak INTO wa_vbak WITH KEY vbeln = wa_vbep-vbeln
BINARY SEARCH.
IF sy-subrc = 0.
wa_vbep_all-soldto = wa_vbak-kunnr.
ENDIF. " IF SY-SUBRC = 0.
READ TABLE i_vbpa INTO wa_vbpa WITH KEY vbeln = wa_vbep-vbeln
BINARY SEARCH.
IF sy-subrc = 0.
wa_vbep_all-shipto = wa_vbpa-kunnr.
ENDIF. " IF SY-SUBRC = 0.
APPEND wa_vbep_all TO i_vbep_all.
CLEAR: wa_vbep,wa_vbap,wa_marc_all,wa_vbep_all,wa_vbak,wa_vbpa.
ENDLOOP. " LOOP AT i_vbep
ENDIF. "i_vbep is INITIAL
ENDFORM. " process_data
*& Form get_rem_quantity
FORM get_rem_quantity.
*Types Declaration
TYPES: BEGIN OF lt_sch_agmts ,
vbeln LIKE vbak-vbeln, "Sales Document
posnr LIKE vbap-posnr, "Item No
END OF lt_sch_agmts,
BEGIN OF lt_doc_types,
vbeln LIKE vbak-vbeln, "Sales Document
vbtyp LIKE vbak-vbtyp, "Document type
END OF lt_doc_types.
*Internal Tables Declaration.
DATA: it_vbfa_data TYPE STANDARD TABLE OF vbfa,
it_vbup_data TYPE STANDARD TABLE OF vbup,
it_vbep_data TYPE STANDARD TABLE OF vbepvb,
it_vbap_data TYPE STANDARD TABLE OF vbapvb,
it_sub_vbfa_data TYPE STANDARD TABLE OF vbfa,
it_sub_vbup_data TYPE STANDARD TABLE OF vbup,
it_sub_vbep_data TYPE STANDARD TABLE OF vbepvb,
it_sub_vbap_data TYPE STANDARD TABLE OF vbapvb,
it_sch_agmts TYPE STANDARD TABLE OF lt_sch_agmts,
it_doc_types TYPE STANDARD TABLE OF lt_doc_types.
*Work area declaration.
DATA: l_vbfa_data LIKE LINE OF it_vbfa_data,
l_vbup_data LIKE LINE OF it_vbup_data,
l_vbep_data LIKE LINE OF it_vbep_data,
l_vbap_data LIKE LINE OF it_vbap_data,
l_sub_vbfa_data LIKE LINE OF it_sub_vbfa_data,
l_sub_vbup_data LIKE LINE OF it_sub_vbup_data,
l_sub_vbep_data LIKE LINE OF it_sub_vbep_data,
l_sub_vbap_data LIKE LINE OF it_sub_vbap_data,
l_sch_agmts LIKE LINE OF it_sch_agmts,
l_doc_types LIKE LINE OF it_doc_types.
*ranges
RANGES: r_vbtyp FOR vbak-vbtyp.
*local variables
DATA: l_tabix LIKE sy-tabix.
CLEAR r_vbtyp[].
r_vbtyp-sign = 'I'. r_vbtyp-option = 'EQ'. r_vbtyp-low = 'E'.
APPEND r_vbtyp. CLEAR r_vbtyp.
r_vbtyp-sign = 'I'. r_vbtyp-option = 'EQ'. r_vbtyp-low = 'F'.
APPEND r_vbtyp. CLEAR r_vbtyp.
CLEAR it_doc_types[].
IF NOT i_vbep_all[] IS INITIAL.
SELECT vbeln
vbtyp
INTO TABLE it_doc_types
FROM vbak
FOR ALL ENTRIES IN i_vbep_all
WHERE vbeln = i_vbep_all-vbeln.
ENDIF.
SORT it_doc_types BY vbtyp.
DELETE it_doc_types WHERE NOT vbtyp IN r_vbtyp.
SORT it_doc_types BY vbeln.
LOOP AT i_vbep_all INTO wa_vbep_all.
READ TABLE it_doc_types INTO l_doc_types
WITH KEY vbeln = wa_vbep_all-vbeln BINARY SEARCH.
IF sy-subrc = 0 .
l_sch_agmts-vbeln = wa_vbep_all-vbeln.
l_sch_agmts-posnr = wa_vbep_all-posnr.
APPEND l_sch_agmts TO it_sch_agmts.
CLEAR l_sch_agmts.
ENDIF.
CLEAR : wa_vbep_all,l_doc_types.
ENDLOOP.
SORT it_sch_agmts.
DELETE ADJACENT DUPLICATES FROM it_sch_agmts COMPARING
vbeln posnr.
IF NOT it_sch_agmts[] IS INITIAL.
SELECT *
FROM vbfa
INTO TABLE it_vbfa_data
FOR ALL ENTRIES IN it_sch_agmts
WHERE vbelv = it_sch_agmts-vbeln
AND posnv = it_sch_agmts-posnr.
SELECT *
FROM vbup
INTO TABLE it_vbup_data
FOR ALL ENTRIES IN it_sch_agmts
WHERE vbeln = it_sch_agmts-vbeln
AND posnr = it_sch_agmts-posnr.
SELECT *
FROM vbep
INTO TABLE it_vbep_data
FOR ALL ENTRIES IN it_sch_agmts
WHERE vbeln = it_sch_agmts-vbeln
AND posnr = it_sch_agmts-posnr.
SELECT *
FROM vbap
INTO TABLE it_vbap_data
FOR ALL ENTRIES IN it_sch_agmts
WHERE vbeln = it_sch_agmts-vbeln
AND posnr = it_sch_agmts-posnr.
LOOP AT it_sch_agmts INTO l_sch_agmts .
CLEAR: it_sub_vbfa_data[], it_sub_vbup_data[],it_sub_vbep_data[],
it_sub_vbap_data[].
LOOP AT it_vbfa_data INTO l_vbfa_data
WHERE vbelv = l_sch_agmts-vbeln AND posnv = l_sch_agmts-posnr.
l_sub_vbfa_data = l_vbfa_data.
APPEND l_sub_vbfa_data TO it_sub_vbfa_data.
CLEAR : l_sub_vbfa_data,l_vbfa_data.
ENDLOOP. "LOOP AT it_vbfa_data into l_vbfa_data
LOOP AT it_vbup_data INTO l_vbup_data
WHERE vbeln = l_sch_agmts-vbeln AND posnr = l_sch_agmts-posnr.
l_sub_vbup_data = l_vbup_data.
APPEND l_sub_vbup_data TO it_sub_vbup_data.
CLEAR : l_sub_vbup_data,l_vbup_data.
ENDLOOP. " LOOP AT it_vbup_data Into l_vbup_data
LOOP AT it_vbep_data INTO l_vbep_data
WHERE vbeln = l_sch_agmts-vbeln AND posnr = l_sch_agmts-posnr.
l_sub_vbep_data = l_vbep_data.
APPEND l_sub_vbep_data TO it_sub_vbep_data.
CLEAR : l_sub_vbep_data,l_vbep_data.
ENDLOOP. " LOOP AT it_vbep_data INTO l_vbep_data
LOOP AT it_vbap_data INTO l_vbap_data
WHERE vbeln = l_sch_agmts-vbeln AND posnr = l_sch_agmts-posnr.
l_sub_vbap_data = l_vbap_data.
APPEND l_sub_vbap_data TO it_sub_vbap_data.
CLEAR : l_sub_vbap_data, l_vbap_data.
ENDLOOP. " LOOP AT it_vbap_data INTO l_vbap_data
CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
EXPORTING
fbeleg = l_sch_agmts-vbeln
fposnr = l_sch_agmts-posnr
TABLES
fvbfa = it_sub_vbfa_data
fvbup = it_sub_vbup_data
fxvbep = it_sub_vbep_data
fvbap = it_sub_vbap_data
EXCEPTIONS
fehler_bei_lesen_fvbup = 1
fehler_bei_lesen_fxvbep = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT i_vbep_all INTO wa_vbep_all
WHERE vbeln = l_sch_agmts-vbeln.
l_tabix = sy-tabix.
READ TABLE it_sub_vbep_data INTO l_sub_vbep_data
WITH KEY vbeln = wa_vbep_all-vbeln
posnr = wa_vbep_all-posnr
etenr = wa_vbep_all-etenr.
IF sy-subrc EQ 0.
wa_vbep_all-olfmng = l_sub_vbep_data-olfmng.
MODIFY i_vbep_all FROM wa_vbep_all
INDEX l_tabix TRANSPORTING olfmng.
ENDIF. " IF SY-SUBRC EQ 0.
ENDLOOP. " LOOP AT i_vbep_all INTO wa_vbep_all
ENDIF. " IF SY-SUBRC EQ 0.
CLEAR l_sch_agmts.
ENDLOOP. "LOOP AT it_sch_agmts INTO l_sch_agmts .
ENDIF. "IF NOT it_sch_agmts[] IS INITIAL.
ENDFORM. " get_rem_quantity
*& Form get_final_output
FORM get_final_output.
DATA:l_vbeln LIKE vbep-vbeln, "Sales Document
l_posnr LIKE vbep-posnr, "Item
l_edatu LIKE vbep-edatu, "Delivery Date
l_tabix TYPE sy-tabix. "Index
IF NOT i_vbep_all IS INITIAL.
*Delete records which are beyond given deleivery date only.
LOOP AT i_vbep_all INTO wa_vbep_all.
l_vbeln = wa_vbep_all-vbeln.
l_posnr = wa_vbep_all-posnr.
l_edatu = wa_vbep_all-edatu.
AT NEW posnr.
IF NOT g_date IS INITIAL.
IF l_edatu > g_date.
DELETE i_vbep_all WHERE vbeln = l_vbeln
AND posnr = l_posnr.
IF sy-subrc = 0.
CONTINUE.
ENDIF. " IF SY-SUBRC = 0.
ENDIF. " IF l_edatu > g_date.
ELSE.
IF l_edatu > s_edatu-low.
DELETE i_vbep_all WHERE vbeln = l_vbeln
AND posnr = l_posnr.
IF sy-subrc = 0.
CONTINUE.
ENDIF. "IF SY-SUBRC = 0.
ENDIF. "IF l_edatu > s_edatu-low.
ENDIF. " g_date IS INITIAL
ENDAT. " AT NEW posnr.
*Delete Records where order quantity is 0 and open quantity is also 0.
IF wa_vbep_all-wmeng EQ 0 AND wa_vbep_all-olfmng EQ 0.
DELETE i_vbep_all. "Deletes current row.
ENDIF. " IF wa_vbep_all-wmeng EQ 0 AND wa_vbep_all-olfmng EQ 0.
CLEAR:wa_vbep_all,l_vbeln,l_posnr.
ENDLOOP. " LOOP AT i_vbep_all INTO wa_vbep_all.
SORT i_vbep_all DESCENDING.
LOOP AT i_vbep_all INTO wa_vbep_all.
l_tabix = sy-tabix.
AT NEW posnr .
SUM.
g_totalopen = wa_vbep_all-olfmng.
ENDAT. " AT NEW posnr .
IF g_totalopen > 0 AND wa_vbep_all-wmeng > 0.
IF wa_vbep_all-wmeng < g_totalopen.
wa_vbep_all-olfmng = wa_vbep_all-wmeng.
g_totalopen = g_totalopen - wa_vbep_all-wmeng.
ELSEIF wa_vbep_all-wmeng GE g_totalopen.
wa_vbep_all-olfmng = g_totalopen.
g_totalopen = 0.
ENDIF. " IF wa_vbep_all-wmeng < g_totalopen.
MODIFY i_vbep_all FROM wa_vbep_all
INDEX l_tabix TRANSPORTING olfmng.
ENDIF. " IF g_totalopen > 0 AND wa_vbep_all-wmeng > 0.
ENDLOOP. " LOOP AT i_vbep_all INTO wa_vbep_all.
*Sort Back In Ascending Order
SORT i_vbep_all.
*DELETE Records where open quantity is 0 .
IF NOT i_vbep_all IS INITIAL.
DELETE i_vbep_all WHERE wmeng = 0 .
ENDIF. " IF NOT i_vbep_all IS INITIAL.
*DELETE Records to get records within delivery date range.
IF NOT g_date IS INITIAL.
DELETE i_vbep_all WHERE edatu > g_date.
ELSEIF g_date IS INITIAL.
DELETE i_vbep_all WHERE edatu > s_edatu-low.
ENDIF. " IF NOT g_date IS INITIAL.
*Populate Final Output Internal Table
LOOP AT i_vbep_all INTO wa_vbep_all.
wa_output-dispo = wa_vbep_all-dispo.
wa_output-dsnam = wa_vbep_all-dsnam.
wa_output-matnr = wa_vbep_all-matnr.
wa_output-maktx = wa_vbep_all-maktx.
wa_output-vbeln = wa_vbep_all-vbeln.
wa_output-posnr = wa_vbep_all-posnr.
wa_output-edatu = wa_vbep_all-edatu.
wa_output-dispo = wa_vbep_all-dispo.
wa_output-wmeng = wa_vbep_all-wmeng.
wa_output-olfmng = wa_vbep_all-olfmng.
wa_output-soldto = wa_vbep_all-soldto.
wa_output-shipto = wa_vbep_all-shipto.
wa_output-shipqty = wa_vbep_all-wmeng - wa_vbep_all-olfmng.
wa_output-fill =
( wa_output-shipqty / wa_vbep_all-wmeng ) * 100.
APPEND wa_output TO o_output.
CLEAR: wa_output,wa_vbep_all.
ENDLOOP. " LOOP AT i_vbep_all INTO wa_vbep_all.
ENDIF. " IF NOT i_vbep_all IS INITIAL.
ENDFORM. " get_final_output
*& Form process_output
FORM calc_mrpcontroller_%fill.
DATA:l_shipqty TYPE olfmng, "Shipped Quantity
l_wmeng LIKE vbep-wmeng, "Order Quantity
l_fill TYPE olfmng, "%fill
l_dispo LIKE t024d-dispo. "Mrp Controller
IF NOT o_output IS INITIAL.
SORT o_output BY dispo.
LOOP AT o_output INTO wa_output.
l_dispo = wa_output-dispo.
AT NEW dispo.
SUM.
l_shipqty = wa_output-shipqty.
l_wmeng = wa_output-wmeng.
ENDAT. " AT NEW dispo
l_fill = ( l_shipqty / l_wmeng ) * 100 .
wa_output-controllerfill = l_fill.
MODIFY o_output FROM wa_output TRANSPORTING controllerfill
WHERE dispo = l_dispo.
CLEAR:wa_output.
ENDLOOP. "LOOP AT o_output INTO wa_output.
ENDIF. "IF NOT o_output IS INITIAL.
ENDFORM. " calc_mrpcontroller_%fill
*& Form calc_material_%fill
*To Calculate Total % Fill By Material.
FORM calc_material_%fill.
DATA: l_shipqty TYPE olfmng, "Shipped Quantity
l_wmeng TYPE vbep-wmeng, "Order Quantity
l_fill TYPE olfmng, "%fill
l_matnr TYPE mara-matnr. "Material
IF NOT o_output IS INITIAL.
SORT o_output BY dispo matnr.
LOOP AT o_output INTO wa_output.
l_matnr = wa_output-matnr.
AT NEW matnr.
SUM.
l_shipqty = wa_output-shipqty.
l_wmeng = wa_output-wmeng.
ENDAT. " AT NEW matnr.
l_fill = ( l_shipqty / l_wmeng ) * 100 .
wa_output-materialfill = l_fill.
MODIFY o_output FROM wa_output TRANSPORTING materialfill
WHERE matnr = l_matnr.
CLEAR:wa_output.
ENDLOOP. "LOOP AT o_output INTO wa_output.
ENDIF. "IF NOT o_output IS INITIAL.
ENDFORM. " calc_material_%fill
*& Form fill_catalogue
FORM fill_catalogue.
CLEAR: i_fieldcat[].
PERFORM build_fieldcat using 1 'DISPO' 'O_OUTPUT' 15 ' '
'MRP Controller'(005) ' ' i_fieldcat.
PERFORM build_fieldcat using 2 'DSNAM' 'O_OUTPUT' 15 ' '
'Controller Name'(006) ' ' i_fieldcat.
PERFORM build_fieldcat using 3 'MATNR' 'O_OUTPUT' 10 ' '
'Material'(007) c_c i_fieldcat.
PERFORM build_fieldcat using 4 'MAKTX' 'O_OUTPUT' 20 ' '
'Material Description'(008) ' ' i_fieldcat.
PERFORM build_fieldcat using 5 'VBELN' 'O_OUTPUT' 12 ' '
'SD Agreement'(009) c_c i_fieldcat.
PERFORM build_fieldcat using 6 'POSNR' 'O_OUTPUT' 4 ' '
'Item'(010) ' ' i_fieldcat.
PERFORM build_fieldcat using 7 'EDATU' 'O_OUTPUT' 13 ' '
'Delivery Date'(011) ' ' i_fieldcat.
PERFORM build_fieldcat using 8 'WMENG' 'O_OUTPUT' 20 c_x
'Scheduled Quantity'(012) c_c i_fieldcat.
PERFORM build_fieldcat using 9 'SHIPQTY' 'O_OUTPUT' 16 c_x
'Shipped Quantity'(013) c_c i_fieldcat.
PERFORM build_fieldcat using 10 'OLFMNG' 'O_OUTPUT' 12 c_x
'REM Quantity'(014) c_c i_fieldcat.
PERFORM build_fieldcat using 11 'FILL' 'O_OUTPUT' 6 ' '
'% Fill Per SchedLine'(025) c_c i_fieldcat.
PERFORM build_fieldcat using 12 'MATERIALFILL' 'O_OUTPUT' 21 ' '
'Tot %Fill By Material'(023) c_c i_fieldcat.
PERFORM build_fieldcat using 13 'CONTROLLERFILL' 'O_OUTPUT' 24 ' '
'Tot %Fill By MRP Contro.'(024) c_c i_fieldcat.
PERFORM build_fieldcat using 14 'SOLDTO' 'O_OUTPUT' 8 ' '
'SoldTo'(016) ' ' i_fieldcat.
PERFORM build_fieldcat using 15 'SHIPTO' 'O_OUTPUT' 8 ' '
'ShipTo'(017) ' ' i_fieldcat.
*Sort by mrp Controller.
fs_sort-spos = 1.
fs_sort-fieldname = 'DISPO'.
fs_sort-up = c_x.
APPEND fs_sort TO i_sort.
CLEAR fs_sort.
*Sort and subtotal by controller description and subtotal.
fs_sort-spos = 2.
fs_sort-fieldname = 'DSNAM'.
fs_sort-up = c_x.
fs_sort-subtot = c_x.
APPEND fs_sort TO i_sort.
CLEAR fs_sort.
*Sort by material.
fs_sort-spos = 3.
fs_sort-fieldname = 'MATNR'.
fs_sort-up = c_x.
APPEND fs_sort TO i_sort.
CLEAR fs_sort.
*Sort and subtotal by material description.
fs_sort-spos = 4.
fs_sort-fieldname = 'MAKTX'.
fs_sort-up = c_x.
fs_sort-subtot = c_x.
APPEND fs_sort TO i_sort.
CLEAR fs_sort.
ENDFORM. " fill_catalogue
*& Form display_output
FORM display_output.
IF o_output IS INITIAL.
MESSAGE e208(00) WITH text-022.
ELSE.
SORT o_output BY dispo matnr vbeln posnr edatu.
ENDIF. " IF o_output IS INITIAL.
MOVE c_x TO fs_layout-colwidth_optimize.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = fs_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
i_save = 'A'
TABLES
t_outtab = o_output.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " display_output
*& Form t_code_check
FORM t_code_check.
**validate authorization against transaction code
SELECT tcode FROM tstc
UP TO 1 ROWS
INTO g_tcode
WHERE pgmna = sy-repid.
ENDSELECT.
IF sy-subrc = 0.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD g_tcode.
IF sy-subrc NE 0.
MESSAGE e261(sf) WITH g_tcode.
ENDIF. "IF SY-SUBRC NE 0.
ENDIF. "IF SY-SUBRC = 0.
ENDFORM. " t_code_check
*& Form validate_doc_type
FORM validate_doc_type.
DATA:l_auart LIKE tvak-auart. "validate document type
SELECT auart
FROM tvak
UP TO 1 ROWS
INTO l_auart
WHERE auart IN s_auart.
ENDSELECT.
IF sy-subrc NE 0 AND NOT l_auart IS INITIAL .
MESSAGE e000(oo)
WITH 'Please enter a valid document type'(019).
ENDIF.
ENDFORM. " validate_doc_type
*& Form plant_auth_check
FORM plant_auth_check.
*Types declaration for werks
TYPES:BEGIN OF lt_werks,
werks TYPE marc-werks,
END OF lt_werks.
*internal table and wrk area to hold multiple plants
DATA :li_werks TYPE STANDARD TABLE OF lt_werks,
l_werks LIKE LINE OF li_werks.
SELECT werks
FROM t001w
INTO TABLE li_werks
WHERE werks IN s_werks.
IF sy-subrc EQ 0.
LOOP AT li_werks INTO l_werks.
AUTHORITY-CHECK OBJECT 'Z_MM_PLANT'
ID 'ACTVT' FIELD c_act_auth_03
ID 'WERKS' FIELD l_werks
ID 'TCD' FIELD g_tcode.
IF sy-subrc NE 0.
MESSAGE e004(co) WITH l_werks.
ENDIF. " IF SY-SUBRC NE 0..
ENDLOOP. " LOOP AT li_werks INTO l_werks..
ELSE.
MESSAGE e174(q3) WITH s_werks.
ENDIF. " IF SY-SUBRC EQ 0.....
ENDFORM. " plant_auth_check
*& Form validate_mrp_controller
FORM validate_mrp_controller.
DATA: l_dispo LIKE t024d-dispo. "mrp Controller
SELECT dispo
FROM t024d
UP TO 1 ROWS
INTO l_dispo
WHERE dispo IN s_dispo.
ENDSELECT.
IF sy-subrc NE 0 AND NOT l_dispo IS INITIAL.
MESSAGE e000(oo)
WITH 'Please enter a valid MRP Controller'(020).
ENDIF. "SY-SUBRC NE 0 AND NOT l_dispo IS INITIAL.
ENDFORM. " validate_mrp_controller
**********************BEGIN OF CDXK961295****************************
*& Form display_summary
FORM process_sum_mrpcontro.
DATA:l_shipqty TYPE olfmng, "Shipped Quantity
l_wmeng LIKE vbep-wmeng, "Order Quantity
l_fill TYPE olfmng, "%fill
l_olfmng TYPE olfmng. "Open Quantity
IF NOT o_output IS INITIAL.
SORT o_output BY dispo.
LOOP AT o_output INTO wa_output.
wa_sum_mrpcontro-dispo = wa_output-dispo.
wa_sum_mrpcontro-dsnam = wa_output-dsnam.
AT END OF dispo.
SUM.
wa_sum_mrpcontro-shipqty = wa_output-shipqty.
wa_sum_mrpcontro-wmeng = wa_output-wmeng.
wa_sum_mrpcontro-olfmng = wa_output-olfmng.
l_fill = ( wa_output-shipqty / wa_output-wmeng ) * 100 .
wa_sum_mrpcontro-controllerfill = l_fill.
APPEND wa_sum_mrpcontro TO i_sum_mrpcontro.
ENDAT. " AT END OF dispo
CLEAR:wa_sum_mrpcontro,wa_output, l_fill.
ENDLOOP. "LOOP AT o_output INTO wa_output.
SORT i_sum_mrpcontro BY dispo.
*Calculate 'total' and add as lastline to internal table .
LOOP AT i_sum_mrpcontro INTO wa_sum_mrpcontro.
l_shipqty = l_shipqty + wa_sum_mrpcontro-shipqty.
l_wmeng = l_wmeng + wa_sum_mrpcontro-wmeng.
l_olfmng = l_olfmng + wa_sum_mrpcontro-olfmng.
CLEAR:wa_sum_mrpcontro.
ENDLOOP. "LOOP AT i_sum_mrpcontro
l_fill = ( l_shipqty / l_wmeng ) * 100 .
wa_sum_mrpcontro-dsnam = 'Total'(015).
wa_sum_mrpcontro-wmeng = l_wmeng.
wa_sum_mrpcontro-shipqty = l_shipqty.
wa_sum_mrpcontro-olfmng = l_olfmng.
wa_sum_mrpcontro-controllerfill = l_fill.
APPEND wa_sum_mrpcontro TO i_sum_mrpcontro.
ENDIF. "IF NOT o_output IS INITIAL.
ENDFORM. " process_sum_mrpcontro.
*& Form fill_catelogue_summary
FORM fill_catelogue_mrpcontro.
CLEAR: i_fieldcat[].
PERFORM build_fieldcat using 1 'DISPO' 'I_SUM_MRPCONTRO' 15 ' '
'MRP Controller'(005) ' ' i_fieldcat.
PERFORM build_fieldcat using 2 'DSNAM' 'I_SUM_MRPCONTRO' 15 ' '
'Controller Name'(006) ' ' i_fieldcat.
PERFORM build_fieldcat using 3 'WMENG' 'I_SUM_MRPCONTRO' 20 ' '
'Scheduled Quantity'(012) c_c i_fieldcat.
PERFORM build_fieldcat using 4 'SHIPQTY' 'I_SUM_MRPCONTRO' 16 ' '
'Shipped Quantity'(013) c_c i_fieldcat.
PERFORM build_fieldcat using 5 'OLFMNG' 'I_SUM_MRPCONTRO' 12 ' '
'REM Quantity'(014) c_c i_fieldcat.
PERFORM build_fieldcat using 6 'CONTROLLERFILL' 'I_SUM_MRPCONTRO' 24
' ' 'Tot %Fill By MRP Contro.'(024) c_c i_fieldcat.
ENDFORM. " fill_catelogue_mrpcontro.
*& Form display_output
FORM display_sum_mrpcontro.
IF i_sum_mrpcontro IS INITIAL.
MESSAGE e208(00) WITH text-022.
ELSE.
ENDIF. " IF o_output IS INITIAL.
fs_layout-colwidth_optimize = c_x.
*To disable option of sort,and sum.
DATA:lr_extab TYPE slis_extab.
lr_extab-fcode = '&OUP'.
APPEND lr_extab TO i_extab.
lr_extab-fcode = '&ODN'.
APPEND lr_extab TO i_extab.
lr_extab-fcode = '&UMC'.
APPEND lr_extab TO i_extab.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = fs_layout
it_fieldcat = i_fieldcat
i_save = 'A'
IT_EXCLUDING = i_extab
TABLES
t_outtab = i_sum_mrpcontro.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " display_sum_mrpcontro
*& Form process_sum_material
FORM process_sum_material.
DATA:l_shipqty TYPE olfmng, "Shipped Quantity
l_wmeng LIKE vbep-wmeng, "Order Quantity
l_fill TYPE olfmng, "%fill
l_olfmng TYPE olfmng. "Open Quantity
IF NOT o_output IS INITIAL.
SORT o_output BY dispo matnr.
LOOP AT o_output INTO wa_output.
wa_sum_material-dispo = wa_output-dispo.
wa_sum_material-dsnam = wa_output-dsnam.
wa_sum_material-matnr = wa_output-matnr.
wa_sum_material-maktx = wa_output-maktx.
AT END OF matnr.
SUM.
l_fill = ( wa_output-shipqty / wa_output-wmeng ) * 100 .
wa_sum_material-wmeng = wa_output-wmeng.
wa_sum_material-shipqty = wa_output-shipqty.
wa_sum_material-olfmng = wa_output-olfmng.
wa_sum_material-materialfill = l_fill.
APPEND wa_sum_material TO i_sum_material.
ENDAT. " AT END OF matnr
CLEAR:wa_sum_material,wa_output, l_fill.
ENDLOOP. "LOOP AT o_output INTO wa_output.
SORT i_sum_material BY dispo matnr.
*Calculate 'total' and add as lastline to internal table .
LOOP AT i_sum_material INTO wa_sum_material.
l_shipqty = l_shipqty + wa_sum_material-shipqty.
l_wmeng = l_wmeng + wa_sum_material-wmeng.
l_olfmng = l_olfmng + wa_sum_material-olfmng.
CLEAR:wa_sum_material.
ENDLOOP. "LOOP AT i_sum_material
l_fill = ( l_shipqty / l_wmeng ) * 100 .
wa_sum_material-dsnam = 'Total'(015).
wa_sum_material-wmeng = l_wmeng.
wa_sum_material-shipqty = l_shipqty.
wa_sum_material-olfmng = l_olfmng.
wa_sum_material-materialfill = l_fill.
APPEND wa_sum_material TO i_sum_material.
ENDIF. "IF NOT o_output IS INITIAL.
ENDFORM. " process_sum_material
*& Form fill_catelogue_material
FORM fill_catelogue_material.
CLEAR: i_fieldcat[].
PERFORM build_fieldcat using 1 'DISPO' 'I_SUM_MATERIAL' 15 ' '
'MRP Controller'(005) ' ' i_fieldcat.
PERFORM build_fieldcat using 2 'DSNAM' 'I_SUM_MATERIAL' 15 ' '
'Controller Name'(006) ' ' i_fieldcat.
PERFORM build_fieldcat using 3 'MATNR' 'I_SUM_MATERIAL' 10 ' '
'Material'(007) c_c i_fieldcat.
PERFORM build_fieldcat using 4 'MAKTX' 'I_SUM_MATERIAL' 20 ' '
'Material Description'(008) ' ' i_fieldcat.
PERFORM build_fieldcat using 5 'WMENG' 'I_SUM_MATERIAL' 20 ' '
'Scheduled Quantity'(012) c_c i_fieldcat.
PERFORM build_fieldcat using 6 'SHIPQTY' 'I_SUM_MATERIAL' 16 ' '
'Shipped Quantity'(013) c_c i_fieldcat.
PERFORM build_fieldcat using 7 'OLFMNG' 'I_SUM_MATERIAL' 12 ' '
'REM Quantity'(014) c_c i_fieldcat.
PERFORM build_fieldcat using 8 'MATERIALFILL' 'I_SUM_MATERIAL' 24
' ' 'Tot %Fill By Material'(023) c_c i_fieldcat.
ENDFORM. " fill_catelogue_material
*& Form display_sum_material
FORM display_sum_material.
IF i_sum_material IS INITIAL.
MESSAGE e208(00) WITH text-022.
ELSE.
ENDIF. " IF o_output IS INITIAL.
fs_layout-colwidth_optimize = c_x.
*To disable option of sort,and sum.
DATA:lr_extab TYPE slis_extab.
lr_extab-fcode = '&OUP'.
APPEND lr_extab TO i_extab.
lr_extab-fcode = '&ODN'.
APPEND lr_extab TO i_extab.
lr_extab-fcode = '&UMC'.
APPEND lr_extab TO i_extab.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = fs_layout
it_fieldcat = i_fieldcat
IT_EXCLUDING = i_extab
i_save = 'A'
TABLES
t_outtab = i_sum_material.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " display_sum_material
*& Form Build field catelogue
*This subroutine takes paremeters.
*p_colpos-->column no. in alv
*p_fieldname-->name of column in internal table type char
*p_tabname-->name of internal table type char
*p-outputlen--> output length of column.
*p_do_sum--> flag to set subtotal
*p_coltext--> column heading type char
*p_just--> flag to set center justify type char
FORM build_fieldcat USING p_colpos p_fieldname p_tabname p_outputlen
p_do_sum p_coltext p_just p_output like i_fieldcat[].
DATA : l_fieldcat LIKE LINE OF i_fieldcat. "wrk area for field catelog
l_fieldcat-col_pos = p_colpos.
l_fieldcat-fieldname = p_fieldname.
l_fieldcat-tabname = p_tabname.
l_fieldcat-outputlen = p_outputlen.
l_fieldcat-do_sum = p_do_sum.
l_fieldcat-seltext_l = p_coltext.
l_fieldcat-just = p_just.
APPEND l_fieldcat TO p_output.
CLEAR l_fieldcat.
ENDFORM. " BUILD_FIELDCAT
**********************END OF CDXK961295**************************** -
Updating Scheduling data for Purchase Order
Hi,
I need a function module which can update the scheduling data for purchase order in EKET table. Normally we create Purchase Order as a reference from purchase requisition through BAPI_PO_CREATE1. That time it takes care of all the scenarios. But as per the requirement I want to create a PO which is created from more than one Purchase Requistions so I can't use the said BAPI. But still I am using this BAPI and after creation is completed I am updating the Requistions. The same scenario is taken care in ME59N, but I can't copy that code because of some requirements. So could any one please give me the idea to replicate the same functionality with any function module or other ways.
Thanks
Somnath paultry to pass all u sheduling related fields to POSCHEDULE and make sure u have enabled POSCHEDULEX along with sheduling related fields .....also (if no changes are there leave it with space )...
this will definetly update not only eket table ....it will update every table regarding to purchase order,ekpo,ekko,eket ...etc
Example of population of BAPI interface in the Function
Parameter: POHEADER
COMP_CODE = 1000
DOC_TYPE = NB
ITEM_INTVL = 00001
VENDOR = 0000001000
PMNTTRMS = 0001
PURCH_ORG = 1000
PUR_GROUP = 001
CURRENCY = EUR
Parameter: POHEADERX
COMP_CODE = X
DOC_TYPE = X
ITEM_INTVL = X
VENDOR = X
PMNTTRMS = X
PURCH_ORG = X
PUR_GROUP = X
Parameter: POITEM
PO_ITEM = 00001
MATERIAL = 100-100
PLANT = 1000
STGE_LOC = 0001
QUANTITY = 15.000
TAX_CODE = V0
ITEM_CAT = 0
ACCTASSCAT = K
Parameter: POITEMX
PO_ITEM = 00001
MATERIAL = X
PLANT = X
STGE_LOC = X
QUANTITY = X
TAX_CODE = X
ITEM_CAT = X
ACCTASSCAT = X
Parameter: POSCHEDULE
PO_ITEM = 00001
SCHED_LINE = 0001
DELIVERY_DATE = 02.12.2002
QUANTITY = 6.000
PO_ITEM = 00001
SCHED_LINE = 0002
DELIVERY_DATE = 03.12.2002
QUANTITY = 5.000
PO_ITEM = 00001
SCHED_LINE = 0003
DELIVERY_DATE = 04.12.2002
QUANTITY = 4.000
Parameter: POSCHEDULEX
PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0002
Parameter: POACCOUNT
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = 15.000
GL_ACCOUNT = 0000400000
COSTCENTER = 0000001000
CO_AREA = 1000
Parameter: POACCOUNTX
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = X
GL_ACCOUNT = X
COSTCENTER = X
CO_AREA = X
Parameter: POCOND
ITM_NUMBER = 000001
COND_ST_NO = 001
COND_TYPE = PB00
COND_VALUE = 79.900000000
CURRENCY = EUR
CURRENCY_ISO = EUR
COND_UNIT = KG
COND_P_UNT = 1
CHANGE_ID = U
Parameter: POCONDX
ITM_NUMBER = 000001
COND_ST_NO = 000
ITM_NUMBERX = X
COND_TYPE = X
COND_VALUE = X
CURRENCY = X
CHANGE_ID = X
Parameter: POPARTNER
PARTNERDESC = OA
LANGU = EN
BUSPARTNO = 0000001100
PARTNERDESC = GS
LANGU = EN
BUSPARTNO = 0000001200
PARTNERDESC = PI
LANGU = EN
BUSPARTNO = 0000001000
reward points if helpful.... -
I'm Dao Duy. I'm from Vietnam.
I've read the information about the tv card "anywhere FM Master" at MSI webpage . I'm interested in it and I want to buy it. But in Vietnam I never seen it yet. I called to your company in Vietnam but they said they don't have it .Can you support me in this case? Please tell me clearly about it (about its sound: stereo or mono? can it record NTSC in AV-in, S-video? Does it have PIP(picture in picture ) function? can it record FM with shedule? how max of resolution can it capture with ? Can it display about its working mode in monitor? is the sound so late as picture? is the picture broken?
Please tell me clearly.ThanksHi,
Is this the item you're after?:
http://www.msi.com.tw/program/products/vga/vga/pro_vga_detail.php?UID=460
the downloadable manual (PDF Format) may help.
Sorry Dao, this is a forum run by volunteers (not MSI employees) to give advice to people who need advice about MSI products they have already bought or are about to buy. You need to contact MSI directly for support.
You never know though - if anyone reading your post has any experience of the card you're after I'm sure they'll post the information you require. Anyway, good luck.
Axel :D -
Problem with *serial no. profile* in work sheduling view of material master
Hi ! !
I am here with a problem with serial no. profile in work sheduling view of material master.
By mistake for some FHMI type ( PRODUCTION RESOURCE TOOLS )materials, serial no profile exist in 'work sheduling' view. Due to that we are facing problem in GRN.
when I am trying to remove that with MM02. i m getting a message as Serial numbers already assigned to this material
Please suggest how to remove serial no. profile.
Thanks in advance,
PrabHi,
go to MMBE and check the Current Serial number...for FHMI type
and go to IQ02 and close the Serial number range at the Current number range...
Now you can assign this serial number range to another material type...
Thx
Raju -
Want to shedule a report in background with current system date
Dear All,
I want to schedule a report which is having date parameters in the selection screen.
What i want is that , every time in the schedulling period the report should run in current system date only with a variant.
Would it be possible.
Thanks in Advance.
With Regards
ShantanuYes possible by 2 ways.
I) This way you can use the current date dynamically
Go to your variants in change mode,
1. Check the box 'Selection Variable' for date.
2. Click on selection variables
3. Choose 'D' for dynamic date calc
4. Choose current date and save.
II)Default it in code
Default sy-datum for the selection variable.
Hope this helps. -
Shedule agreement with item category D
Dear All,
can i create an shedule agreement for services using item category 'D'
Regards
mspPlease check the allowed item categories in the cutomizing under MM-> Purchasing-> Scheduling agrement-> define document types. Standard SAP has not defined SA to be created for item category D.
However you can add it over here and check if it works.
Edited by: Subramaniam Iyer on Dec 1, 2008 9:57 AM -
Report for shedule vs supply and report for opening stock at back date.
Dear All Guru,
please can anybody reply me is there any standard report is available for
1) Report for shedule vs supply
2) and report for opening stock at back date.(ex- opening stock at last month 16th july or two months back on 10th may
pl suggest if any standard report is available or how we can data for this
Regards,
VimleshHi,
To see the opening stock at a particular date use T.Code: MB5B,
To see the scheduled quantity & delivered quantity use table EKET with the filed names MENGE & WEMNG.
Regards,
Prabu -
Dear Experts,
1. user is created one sales order having different sheduleline dates.
for current date they deliveried stocks to customer.
Now the user wants to know what are all the orders are due for next shedule lines
Please let us know how we can see the next shedule line dates in the sales orders which needs to deliver.
generally user they dont want enter in sales orders again and again to know. is there any report to know.
2. for next shedule line date automatically the popup will come in the screen
for ex. "in xxxx date xxxx sales order is due for delivery"
Please help me out on the above cases what needs to done in the configuration
Thanks
Raju..Hi there,
This is possible through reports.
Ask your ABAPer to develop a report that reads a customer selection criteria from the selection scrren.
1.reads all open orders.
2. Read the schedule line data for the open items in the order.
3. Download the information into an Excel & mail it to the customers.
4. Make sure that you get these datails only when the user runs the report manually giving the selection criteria.
Discuss with the business what selection cretiria they want like customer num, from & to dates etc.
Regards,
Sivanand -
I have been operating my MacBook Pro 15" (Mac OS 10.7.5), with Windows 7 - Parallels Desktop, for about one and one-half years. However, whenever I execute a Time Machine back-up, and leave the system to complete the process, I return only to find that my system has re-booted, long before the back-up is completed. I do not use the auto-backup feature because I do not see how to change the shedule for backups away from the default schedule of hourly backups (too my stain on performance). Is there something that I am missing in setting up for such a back-up? I am currently operating away from home, using wi-fi for Internet access.
Appreciatively, ArbyemI have been operating my MacBook Pro 15" (Mac OS 10.7.5), with Windows 7 - Parallels Desktop, for about one and one-half years. However, whenever I execute a Time Machine back-up, and leave the system to complete the process, I return only to find that my system has re-booted, long before the back-up is completed. I do not use the auto-backup feature because I do not see how to change the shedule for backups away from the default schedule of hourly backups (too my stain on performance). Is there something that I am missing in setting up for such a back-up? I am currently operating away from home, using wi-fi for Internet access.
Appreciatively, Arbyem -
Overwrite report with scheduled istance.
Hi gurus,
I'd need to schedule a webi report and overwrite the original report with the latest scheduled istance. Searching in forum, I found that this is not possible but it would it possible to set as default the opening of the last successfull istance. But this is still not enought to users requirements, as they sometimes need to save some changes to the report and by default that changes would be not available until next report schedulation (executed monthly).
I would ask if there is any workaround to accomplish this: to let user open the report always in same way (without to switch between "View" and "View latest istance") and get the last modified/executed between the istance and the report object.
Or there any way to create a task to automatically perform the "Save as" of an istance?
Thanks and regards.
Roberto.See,
Sheduled instance is okay, After successful schedule, it has to get latest data available, correct??
To get those data, you have make it "Refresh on Open". Which means that get the latest scheduled instance data from datasource.
In this case you can leave Save As .
Thank You!! -
Scenario with reference to source inspection and MIGO
Hi all,
My scenario as follows:
1.Source Inspection lot should get generated as per the lead time given in Q-Info while creating PO.
2.MIGO should not be allowed when source inspection lot is open(Means UD is not taken).
3.Inspection lot should be generated while doing GR in MIGO when source inspection lot is accepted.
These all three points are with reference to one raw material.
Kindly throw some light on the above said scenarios.
Thanks in advance
SudharDear Sudhar
1) For generating inspection lot automaticaly please use QA51. here you can shedule the program as in Qi07 and can be sheduled in a defined frequency
2) You may have to go for user exit if you need to stop GR when the source inspection is open. You may use MB_CF001. Please check the exact exits as there is no option in standard for the same
3) just check - in config maintain GR for Rejection - GR not allowed and in quality info record maintain No GR inspection for source inspection
Please let me know the issues
Regards
Gajesh -
Procedure of scheduling agreement with jit
Can any one explain the step by step by procedure of creation of scheduling agreement with jit(just in time)
Vasu,KDear vasu,
The steps are
Step 1: Create Creation Profile in IMG under Scheduling agreement node
Step 2: Assign that creation profile to Material in the material master and the JIT indicator
Step 3: Ensure that creation profile copied to the SA, if not then assign it in the item detail
Step 4: Then run the Transaction for the delivery shedule creation
Ste 5: Check the shedule created
Thanks,
With regards,
Krishna Reddy
Maybe you are looking for
-
Windows 7 boot camp install on 2012 MacBook Pro with retina display
I'm having trouble installing Windows 7 in a boot camp partition on my MBP. When I select the boot camp partition and then format it, the partition is not recognized in the next step. Does any know a way around this? Thanks. Esau
-
Logic 8 Pro Installation/ Logic Express 8 uninstallation question
Is there any reason I need to keep Logic Express 8 installed after I install Logic Pro 8 ? I was hoping to free up some space... I am installing Logic Pro 8 as I type this. I can hardly wait to use it. ; )
-
i have a login in screen(jframe) with username and password, i try to run it from one console(windows command promt) its opening, but what i need is when i run the same jframe from another console how can i check whether this frame is already opened(
-
Hi I was wondering if anyone could help me; is it possible to join up or merge multiple photographs into one photograph to create, for example, a panoramic view? I have a series of photographs spanning a particular scene, and it would be great if I c
-
Anyone Please Suggest me the right SoundC
Hi everyone, Can anyone please suggest me the <SPAN>Appropriate Sound Card. I have bought SBLi've and I found that very essential functionalities for me are missing in this card, which were there in SBLi've "Value". I have 3 requirments stated below.