Table or FM to display inventory for material in plant for a specific time
Hi, is there a table or FM or transaction that can display the plant inventory for a material for certain batch/plant for a specific time? I need to trouble shoot a problem that may be related to delivery not been created on the date determined in the sales order schedule line. Need to see if there is actually sufficient stuff at the time when the delivery due list is executed.
MMBE or MB52 only gives me the inventory level as of the systems date/time. Need to pull out historical data.
Any advise is appreciated.
Thanks
hi
MB5B is one option to get stock on particular date.may be you can chedck MD05 - MRP list to get stock statement at time of MRP run.
Vishal...
Similar Messages
-
Creating Z report for material stock (plant maintenance module)
hello,
we are implemented Plant maintenance module (SAP PM) in our organization.
our requirement is to create a stock report which will incldue
followings:-
1)material number
2)plant number
3) storage location
4) material type
5)valuation type
6)Opening Stock
7) OpValue
8)Received Stock
9) ReceiptValue
10) Issue Stock
11) IssueValue
12) Closing Stock
13) Closing Value
we want above details in ALV grid format.
to gert all the details for perticular material, we calcute closing stock and closing value in following manner:-
opening stock + received stock - issue stock = closing stock
opening value + recipt value - issue value = closing value
we are unable to find table name for accessing opening stock, received stock , issue stock & opening value ,recipt value , issue value from system. please suggest table name information for getting above details for creating Z reportDear friend,
Before to make a decision to bulid a custom report make sure you have checked out the following standard transactions:
MB5T Stock in Transit
MMBE Stock Overview
MD04 Stock/Reqs list
MB53 Plant Stock Availability
MB52 Warehouse Stock
MB5M Expiration Date list
MB5B Stock for Posting Date
MB5T Stock in Transit
MBBS Valuated Special Stock
MBLB Stock with Subcontractor
The possible tables are:
MARA, MARD, MARC, VBEP, VBAK(VBAP), EKKO(EKPO), EKBE, EBAN, EBEW, MSEG, MKPF,...
Good luck! -
Hello all,
my requirement is, system should give error message while creating sales order, if chapter ID is not maintained for a material and plant combination.
please suggest the user exit.Hi
CASE 1 : All Plants are excisable.
In Material master , Foreign Trade data tab- mentioned Control code field mandatory. ( i.e nothing but Chapter ID)
CASE 2 : Few Plants are excisable
In the Case 2 you need to go for Enhancement
Program Name : MV45AFZB
User Exit: USEREXIT_CHECK_VBAP ( Item Level Check )
By using above user exit you write a logic with the help of ABAPer
Plant and Chapter ID combination table : J_1IMTCHID -
Characteristics values for material and plant
Hi Experts,
I need to fetch characterstic values from a class Y-xx . I belive badi BAPI_CLASS_GET_characteristics
will give the result but my problem is in selection screen I am passing material no and plant
for this material and plant i need to fetch the characteristics values from the Y_xx class
Could any one suggest the BADI or FM or tables to fetch the results
Thanks in advanceHi,
Go to MEK2, here enter the freight condition type, go to the output screen as pr the access maintained and select the line item and click on "Scales" button to see the from and to value.
Also you can check the same in "Conditions" button in Purchase Info record. -
Plannning Material and Plant for MRP Run
Hi,
If I have a material (01) extended on 2 plants, on one plant (A) we have production and planning/MRP + stock and on the other one (B), just stocking and transfer. B's requirements are to be entered and planned at A. I also want stock at B to be considered with stock at A when MRP runs at A. In the material master, I have some settings. I want to know if these would be any good:
Material 01 on Plant A:
MRP PD
Strategy 40
Lot size EX
Coverage profile applied
Material 01 on Plant B:
MRP ND/PD tried both
Strategy 40
Lot size EX
Coverage profile applied (same)
Planning material: Material 01 itself
Planning plant: Plant A
I particularly want to know about points 5 and 6. Will they make any difference if I run MRP on scope of planning(all plants) or just plant A? Will stock at B be considered? What difference does that setting make in my case? Please help!
Thanks!No sales on Plant A. Only transfers and STO's. Stock is STO'd to Plant B (and other Plants, as well)
Plant B sells the stock.
Yes, I want to load the forecast in Plant A (COPA to SOP to DM to MRP). What do I do in this case?
I tried another case, as well. In that I put a special procurement on the material in Plant B view and marked it as external procurement. (the planning material and plant were there, didn't remove)
Then I entered the forecast in both plants separately (PIRs for both Plants) The requirements from Plant B made STPO Planned orders in Plant B and STCK Planned orders in Plant A. I am using coverage profiles (period is month, standard length 25 days, target 10 days for 1st period for 2 months, target 10 days for 2nd period for 1 month, target 10 days for the rest of the horizon) Not using any consumption modes.
The results I am getting don't make sense to me. I have attached screen shots for both plants MD04 and the MRP + work scheduling views -
Business object for material , template workflow for materials ?
Hi,
I need to create a workflow for material master , creating material basic data, create plant views etc
Which is the appropriate workflow and is there a standard one as a template?
Thanks
AntonisHello,
I feel it is better that you use the standard business object BUS1001006 for your requirement related to the material management as some of the events which are obsolete in the business object BUS1001 have been redefined in BUS1001006.
Events like "Material created" and "New View for the material Created" are redefined which I think you need for your requirement.
Hope this will help.
Regards,
Samson -
Batch for material in plant already exists
Hi ,
When create a goods reciept for material ABBBBB in plant X001 and sloc 0001 for the first time in a day , system automatically creates a batch number .
When I try to create a goods reciept for the same material in same plant/sloc combination , system gives me an message "Batch for the material already exists in plant " . and it stops me from going to enter values for characteristics .
But system creates a batch automatically when I recieve the same material into same plant with different sloc .
Can anyone suggest me the config or userexit so that system allows me to create a batch with a warning message .
Thanks ,HI
When u r creating batch from MSC1N, u r maintaing for combination of material, batch, plant, storage location. So with this combination u find already existing batch when u enter same material again for plant and sto location combination.
Now when u change the storage location it is creating new batch as it is not there for different combination.
Also you can check configuration in Img -- Log general -- batch management --Creation of new batches -- Creation for Goods movement.
Here u can selct option for particular movement type.
Hope this will solve ur problem in this regard
Reward if u find it helpful
Regards
Amol -
REPORT zbdc_me38
NO STANDARD PAGE HEADING LINE-SIZE 255.
*include bdcrecx1.
*parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
DATA: file_path TYPE string.
DATA:
l_log_handle TYPE balloghndl,
l_s_log TYPE bal_s_log,
l_s_msg TYPE bal_s_msg,
l_msgno TYPE symsgno.
DATA: i_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
* messages of call transaction
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
* error session opened (' ' or 'X')
DATA: E_GROUP_OPENED.
* message texts
TABLES: T100.
DATA: BEGIN OF record OCCURS 0,
* data element: EVRTN
EVRTN_001(010),
* data element: AUFEP
EBELP_002(005),
* data element: TCSELFLAG
TCSELFLAG_01_003(001),
* data element: ETNR1
ETNR1_004(004),
* data element: LPEIN
LPEIN_02_005(001),
* data element: EEIND
EEIND_02_006(010),
* data element: ETMEN
MENGE_02_007(017),
* data element: ETNR1
ETNR1_008(004),
END OF record.
START-OF-SELECTION.
SELECTION-SCREEN BEGIN OF BLOCK mode WITH FRAME TITLE text-003.
PARAMETERS: file_url TYPE rlgrap-filename MODIF ID xyz .
SELECTION-SCREEN END OF BLOCK mode .
INITIALIZATION.
PERFORM log_create.
*PARAMETERS: dataset(132) lower case.
*perform open_dataset using dataset.
*Uploading data from the local file C:\MSchedule.txt
*CALL FUNCTION 'WS_UPLOAD'
* EXPORTING
* FILENAME = 'C:\MSCHEDULE.TXT'
* FILETYPE = 'DAT'
* TABLES
* data_tab = I_BDCDATA .
*IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_url.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ''
IMPORTING
file_name = file_url.
start-of-selection.
IF NOT file_url IS INITIAL.
MOVE file_url TO file_path.
PERFORM read_file.
ENDIF.
LOOP AT record. "Filling the BDC table with data
*read dataset dataset into record.
perform bdc_dynpro using 'SAPMM06E' '0205'.
perform bdc_field using 'BDC_CURSOR'
'RM06E-EVRTN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06E-EVRTN'
record-EVRTN_001.
perform bdc_dynpro using 'SAPMM06E' '0222'.
perform bdc_field using 'BDC_CURSOR'
'RM06E-EVRTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ET'.
perform bdc_field using 'RM06E-EBELP'
record-EBELP_002.
perform bdc_field using 'RM06E-TCSELFLAG(01)'
record-TCSELFLAG_01_003.
perform bdc_dynpro using 'SAPMM06E' '1117'.
perform bdc_field using 'BDC_CURSOR'
'EKET-MENGE(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06E-ETNR1'
record-ETNR1_004.
perform bdc_field using 'RM06E-LPEIN(02)'
record-LPEIN_02_005.
perform bdc_field using 'RM06E-EEIND(02)'
record-EEIND_02_006.
perform bdc_field using 'EKET-MENGE(02)'
record-MENGE_02_007.
perform bdc_dynpro using 'SAPMM06E' '1117'.
perform bdc_field using 'BDC_CURSOR'
'RM06E-LPEIN(02)'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'RM06E-ETNR1'
record-ETNR1_008.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'ME38'.
*perform bdc_dynpro using 'SAPMM06E' '0205'.
*perform bdc_field using 'BDC_CURSOR'
* 'RM06E-EVRTN'.
*perform bdc_field using 'BDC_OKCODE'
* '/00'.
*perform bdc_field using 'RM06E-EVRTN'
* record-EVRTN_001.
*perform bdc_dynpro using 'SAPMM06E' '0222'.
*perform bdc_field using 'BDC_CURSOR'
* 'RM06E-EVRTP(01)'.
*perform bdc_field using 'BDC_OKCODE'
* '=ET'.
*perform bdc_field using 'RM06E-EBELP'
* record-EBELP_002.
*perform bdc_field using 'RM06E-TCSELFLAG(01)'
* record-TCSELFLAG_01_003.
*perform bdc_dynpro using 'SAPMM06E' '1117'.
*perform bdc_field using 'BDC_CURSOR'
* 'EKET-MENGE(02)'.
*perform bdc_field using 'BDC_OKCODE'
* '/00'.
*perform bdc_field using 'RM06E-ETNR1'
* record-ETNR1_004.
*perform bdc_field using 'RM06E-LPEIN(02)'
* record-LPEIN_02_005.
*perform bdc_field using 'RM06E-EEIND(02)'
* record-EEIND_02_006.
*perform bdc_field using 'EKET-MENGE(02)'
* record-MENGE_02_007.
*perform bdc_dynpro using 'SAPMM06E' '1117'.
*perform bdc_field using 'BDC_CURSOR'
* 'RM06E-LPEIN(02)'.
*perform bdc_field using 'BDC_OKCODE'
* '=BU'.
*perform bdc_field using 'RM06E-ETNR1'
* record-ETNR1_008.
*perform bdc_dynpro using 'SAPLSPO1' '0300'.
*perform bdc_field using 'BDC_OKCODE'
* '=YES'.
*perform bdc_transaction using 'ME38'.
WAIT UP TO 2 SECONDS.
clear i_bdcdata[].
CLEAR record.
ENDLOOP.
perform log_show.
*& Form BDC_DYNPRO
* text
* -->PROGRAM text
* -->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
ENDFORM. "BDC_DYNPRO
**& Form BDC_FIELD
** text
** -->FNAM text
** -->FVAL text
FORM bdc_field USING fnam fval.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
ENDFORM. "BDC_FIELD
*& Form BDC_TRANSACTION
* text
* -->TCODE text
FORM bdc_transaction USING tc TYPE sy-tcode.
DATA tcode LIKE tstc-tcode.
* tcode = 'ME38'.
CALL TRANSACTION tc USING i_bdcdata
MODE 'E' " modes can A = step by step foreground.
" mode N = background direct.
" mode E = using error display.
MESSAGES INTO messtab.
PERFORM msg_generation.
ENDFORM. "BDC_TRANSACTION
FORM read_file .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_path
filetype = 'ASC'
has_field_separator = 'X'
* HEADER_LENGTH = 0
read_by_line = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = record
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
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. " read_file
*& Form msg_generation
* text
* --> p1 text
* <-- p2 text
FORM msg_generation .
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
DATA: l_error TYPE c.
LOOP AT messtab.
* add message to log file
CLEAR l_s_msg.
l_s_msg-msgty = messtab-msgtyp.
l_s_msg-msgid = messtab-msgid.
l_s_msg-msgno = messtab-msgnr.
l_s_msg-msgv1 = messtab-msgv1.
l_s_msg-msgv2 = messtab-msgv2.
l_s_msg-msgv3 = messtab-msgv3.
l_s_msg-msgv4 = messtab-msgv4.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = l_log_handle
i_s_msg = l_s_msg
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF messtab-msgtyp EQ 'E' OR l_subrc NE 0.
l_error = 'X'.
ENDIF.
ENDLOOP.
CLEAR messtab[].
ENDFORM. " msg_generation
*& Form log_create
* text
* --> p1 text
* <-- p2 text
FORM log_create .
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = l_s_log
IMPORTING
e_log_handle = l_log_handle
EXCEPTIONS
OTHERS = 1.
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. " log_create
*& Form log_show
* text
* --> p1 text
* <-- p2 text
FORM log_show .
DATA:
l_s_display_profile TYPE bal_s_prof.
* get a prepared profile
CALL FUNCTION 'BAL_DSP_PROFILE_SINGLE_LOG_GET'
IMPORTING
e_s_display_profile = l_s_display_profile
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* use grid for display if wanted
l_s_display_profile-use_grid = 'X'.
* set report to allow saving of variants
l_s_display_profile-disvariant-report = sy-repid.
* when you use also other ALV lists in your report,
* please specify a handle to distinguish between the display
* variants of these different lists, e.g:
l_s_display_profile-disvariant-handle = 'LOG'.
* call display function module
* We do not specify any filter (like I_S_LOG_FILTER, ...,
* I_T_MSG_HANDLE) since we want to display all logs available
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_s_display_profile = l_s_display_profile
EXCEPTIONS
OTHERS = 1.
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. " log_showIt's not possible to delete an iCloud account.
You can turn off the services, but that doesn't delete the account. -
SLoc disabled in MIGO for Material in MIGO for a PO
I am trying to create a MIGO for a PO and one of my materials is disabled and hence am not able to enter the SLoc for that material.
When I SAVE the transaction, I get an error to maintain the SLoc.
How can I maintain the SLoc for my first material now?
Thanks,
KiranHi,
Can you check if the Material Master is set and a Sloc specific view and Plant specific view extist for that material.
Also, check if there are other PO with this material as Line Item and they aleast have the sloc populated in the PO..
You can try to edit the PO to append the sloc.
I have not faced this situation but of the view that , this PO might have got created with incomplete Material Master setup., if the Material Master sloc view is in place and if PO is having Sloc then this issue will not happen.
Hope this help.
Tnx
MJ -
No valid source of supply found for material ABC plant Plant1
Hi ,
I am using the Tcode kkf7 (product cost collector ) for costing a material XYZ(finished prod) , it throughts an error that the material ABC which is an sub assembly of XYZ of type E has no valid source of supply.
Regards,
Reddyhi
you have to maintain purchase info records for subcontracting material, TCODE Me11, procurement type in material master F, special procurement type 30.
In the costing variant assigned check valuation variant strategy for subcontracting
krishna -
APP for two separate plants for same vendor
Hello Experts
I have one company code and two plants. These plants are created as different profit centers. These two plants have their own payment offices and bank accounts. Both of them are individually responsible for payment of their own invoices only.
Now they both procure from one vendor. Say vendor X. Vendor ledger is same. When I see vendor line item report (FBL1N), I can see 70 open line items (open invoices). 40 line items pertains to 1st plant and 30 line items 2nd plant.
Now 1st Plant wants to execute APP. Their requirement is that it should only pick invoices pertaining to their plant only. How its possible?.
Note: since number of invoices are more, mentioning individual invoices in exclusion is not possible.
Please help
-MHi
Select document to change the assignment field in FBL1N through mass change update as PLANT1 for 40 line item and for 30 line items update PLANT2 in assignment.
In F110, select field Assignment and enter value PLANT1. system will pick up only PLANT1 invoices.
for future invoice you can update assignment field through validations, you have to check work around for validations
Regards
Sampat -
hi,
i want a material list for which if i specify a period i will get materials with
a)No goods reciept
b)No stock or material movement(issue/transfer posting etc).
c)no sales or shipping.
should have happened for the materials for that period.
if no standard report exists can you tell me the algoritthm.
urgent: satisfying answers will be awarded full pointsRajkiran,
am sure you will never setisfy even we send you number of report because you have to chenge according to your requirement.dont expect spoon feeding.
*& Object Id : &*
*& Object Name : ZMM_STO_REGISTER &*
*& Function Module Name : MM &*
*& Transaction Code : ZMMSTO &*
*& Author : Amit&*
*& Module Name : MATERIAL MANAGEMENT &*
*& Sub-Module : &*
*& Program Type : Report &*
*& Create Date : 28.03.2007 &*
*& Completion Date : 30.03.2007 &*
*& SAP Release : &*
*& Description : STO REGISTER &*
*& MODIFICATION LOG : MODIFIED AT 30.04.2007 adding new field &*
*& chapter-id by chakrapani mishra &*
REPORT zmm_sto_register.
* TABLES USED *
TABLES :vbrk, "Billing Document: Header Data
vbrp, "Billing Document: Item Data
mara, "General Material Data
konv, "Conditions (Transaction Data)
t023t, "Material Group Descriptions
ekko, "Purchasing Document Header
likp, "SD Document: Delivery Header Data
mvke, "Sales Data for Material
t001w, "Plants/Branches
marm, "Units of Measure for Material
j_1imtchid, "Combination of Material Number and Chapter ID
mseg,
mkpf,
j_1iexchdr.
TYPE-POOLS : slis. "TYPE POOL SLIS
* INTERNAL TABLES *
DATA: BEGIN OF t_vbrp OCCURS 0, "INTERNAL TABLE FOR VBRP
vbeln LIKE vbrp-vbeln, "Billing Document
vstel LIKE vbrp-vstel, "Shipping Point/Receiving Point
vgbel LIKE vbrp-vgbel, "Document number of the reference document
aubel LIKE vbrp-aubel, "Sales Document
matnr LIKE vbrp-matnr, "Material Number
arktx LIKE vbrp-arktx, "Short text for sales order item
matkl LIKE vbrp-matkl, "Material Group
fkimg LIKE vbrp-fkimg, "Actual Invoiced Quantity
werks LIKE vbrp-werks, "Plant
posnr LIKE vbrp-posnr, " Billing item
vrkme LIKE vbrp-vrkme, " Sales unit
vgbel1 LIKE mkpf-xblnr,
END OF t_vbrp.
DATA: BEGIN OF t_vbrk OCCURS 0, "INTERNAL TABLE FOR VBRK
kunag LIKE vbrk-kunag, "Sold-to party
vbeln LIKE vbrk-vbeln, "Billing Document
fkdat LIKE vbrk-fkdat, "Billing date for billing index and printout
knumv LIKE vbrk-knumv, "Number of the document condition
fkart LIKE vbrk-fkart, "Billing Type
vtweg LIKE vbrk-vtweg, "Distribution Channel
vkorg LIKE vbrk-vkorg, "Sales Organization
erzet LIKE vbrk-erzet,
w_flag TYPE c,
l_tabix TYPE sy-tabix,
END OF t_vbrk.
DATA: BEGIN OF t_temp1 OCCURS 0, "INTERNAL TABLE FOR VBRK
vbeln LIKE vbrp-vbeln, "Billing Document
fkart LIKE vbrk-fkart,
fkdat LIKE vbrk-fkdat,
vgbel LIKE vbrp-vgbel, "Document number of the reference document
werks LIKE vbrp-werks,
w_flag TYPE c,
END OF t_temp1.
DATA: BEGIN OF t_mara OCCURS 0, "INTERNAL TABLE FOR MARA
matnr LIKE mara-matnr, "Material Number
mtart LIKE mara-mtart, "Material Type
wrkst LIKE mara-wrkst, "Finish
extwg LIKE mara-extwg, "Design
labor LIKE mara-labor, "Grade/Category No.
normt LIKE mara-normt, "Thickness in mm
bismt LIKE mara-bismt, "Size (L*B) in mm
matkl LIKE mara-matkl,
spart LIKE mara-spart,
meins LIKE mara-meins,
END OF t_mara.
DATA : BEGIN OF t_konv OCCURS 0, "INTERNAL TABLE FOR KONV
knumv LIKE konv-knumv, "Number of the document condition
kposn LIKE konv-kposn, "Condition item number
kschl LIKE konv-kschl, "Condition type
kwert LIKE konv-kwert, "Condition value
kbetr LIKE konv-kbetr, "Condition rate
END OF t_konv.
DATA : BEGIN OF t_likp OCCURS 0, "INTERNAL TABLE FOR LIKP
vbeln LIKE likp-vbeln, "Delivery
lfdat LIKE likp-lfdat, "Delivery Date
kunnr LIKE likp-kunnr,
bldat LIKE likp-bldat, " document date
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
END OF t_likp.
DATA : BEGIN OF t_t023t OCCURS 0, "INTERNAL TABLE FOR T023T
matkl LIKE t023t-matkl, "Material Group
wgbez LIKE t023t-wgbez, "Material Group Description
spras LIKE t023t-spras, "Language Key
END OF t_t023t.
DATA : BEGIN OF t_ekko OCCURS 0, "INTERNAL TABLE FOR EKKO
ebeln LIKE ekko-ebeln, "Purchasing Document Number
bsart LIKE ekko-bsart, "Purchasing Document Type
aedat LIKE ekko-aedat, "Date on Which Record Was Created
knumv LIKE ekko-knumv, "Number of the document condition
END OF t_ekko.
DATA : BEGIN OF t_ekpo OCCURS 0, "INTERNAL TABLE FOR EKKO
ebeln LIKE ekko-ebeln, "Purchasing Document Number
loekz LIKE ekko-loekz, "Purchasing Document Type
END OF t_ekpo.
DATA : BEGIN OF t_mvke OCCURS 0,
matnr LIKE mvke-matnr,
mvgr1 LIKE mvke-mvgr1,
END OF t_mvke.
DATA : BEGIN OF t_t001w OCCURS 0, "INTERNAL TABLE FOR KONV
werks LIKE t001w-werks, "Number of the document condition
name1 LIKE t001w-name1, "Condition type
kunnr LIKE t001w-kunnr, "Condition value
name2 LIKE t001w-name2, "Condition item number
END OF t_t001w.
DATA : BEGIN OF t_t001w2 OCCURS 0, "INTERNAL TABLE FOR KONV
werks LIKE t001w-werks, "Number of the document condition
name1 LIKE t001w-name1, "Condition type
kunnr LIKE t001w-kunnr, "Condition value
name2 LIKE t001w-name2, "Condition item number
END OF t_t001w2.
DATA : BEGIN OF t_marm OCCURS 0,
matnr LIKE marm-matnr,
meinh LIKE marm-meinh,
umrez LIKE marm-umrez,
umren LIKE marm-umren,
END OF t_marm.
DATA : BEGIN OF t_tvm1t OCCURS 0,
mvgr1 LIKE tvm1t-mvgr1,
bezie LIKE tvm1t-bezei,
END OF t_tvm1t.
**********************modification additioon of chapter ID 30.04.2007
DATA : BEGIN OF t_j_1imtchid OCCURS 0, "INTERNAL TABLE FOR j_1imtchid
matnr LIKE j_1imtchid-matnr, "Material Number
j_1ichid LIKE j_1imtchid-j_1ichid, "Chapter ID
END OF t_j_1imtchid.
DATA : BEGIN OF t_j_1iexchdr OCCURS 0, "INTERNAL TABLE FOR j_1imtchid
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
werks LIKE j_1iexchdr-werks,
status LIKE j_1iexchdr-status,
trntyp LIKE j_1iexchdr-trntyp,
END OF t_j_1iexchdr.
**********************modification additioon of chapter ID 30.04.2007
DATA: BEGIN OF t_final OCCURS 0, "INTERNAL TABLE T_FINAL
fkart LIKE vbrk-fkart,
kunag LIKE vbrk-kunag,
vbeln_k LIKE vbrk-vbeln,
fkdat LIKE vbrk-fkdat,
knumv LIKE vbrk-knumv,
fkart1 LIKE vbrk-fkart,
vtweg LIKE vbrk-vtweg,
vkorg LIKE vbrk-vkorg,
vbeln LIKE likp-vbeln, "Delivery
vbeln_p LIKE vbrp-vbeln,
vstel LIKE vbrp-vstel,
"vgbel like mkpf-xblnr,
vgbel LIKE vbrp-vgbel,
aubel LIKE vbrp-aubel,
matnr LIKE vbrp-matnr,
arktx LIKE vbrp-arktx,
matkl LIKE vbrp-matkl,
fkimg LIKE vbrp-fkimg,
posnr LIKE vbrp-posnr,
vrkme LIKE vbrp-vrkme,
matnr_m LIKE mara-matnr,
mtart LIKE mara-mtart,
wrkst LIKE mara-wrkst,
extwg LIKE mara-extwg,
labor LIKE mara-labor,
normt LIKE mara-normt,
bismt LIKE mara-bismt,
spart LIKE mara-spart,
meins LIKE mara-meins,
kposn LIKE konv-kposn,
kschl LIKE konv-kschl,
kwert LIKE konv-kwert,
kwert1 LIKE konv-kwert,
kwert2 LIKE konv-kwert,
kwert3 LIKE konv-kwert,
kwert4 LIKE konv-kwert,
kwert5 LIKE konv-kwert,
kbetr LIKE konv-kbetr,
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
lfdat LIKE likp-lfdat,
wgbez LIKE t023t-wgbez,
spras LIKE t023t-spras,
bsart LIKE ekko-bsart,
aedat LIKE ekko-aedat,
**********************modification additioon of chapter ID 30.04.2007
j_1ichid LIKE j_1imtchid-j_1ichid ,
**********************modification additioon of chapter ID 30.04.2007
total TYPE p DECIMALS 2,
mvgr1 LIKE mvke-mvgr1,
werks LIKE t001w-werks, "Number of the document condition
kunnr LIKE t001w-kunnr, "Condition value
name1 LIKE t001w-name1, "Condition type
name2 LIKE t001w-name2, "Condition item number
werks1 LIKE t001w-werks, "Number of the document condition
kunnr1 LIKE t001w-kunnr, "Condition value
name11 LIKE t001w-name1, "Condition type
name21 LIKE t001w-name2,
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
bom TYPE p DECIMALS 4,
mult TYPE p DECIMALS 4,
bezie LIKE tvm1t-bezei,
length(5) TYPE n,
breath(5) TYPE n,
bldat LIKE likp-bldat, " document date
size(15) TYPE p DECIMALS 2,
area(15) TYPE p DECIMALS 2,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
budat TYPE mkpf-budat, "Posting period
w_flag TYPE c,
flag TYPE c,
END OF t_final.
DATA : BEGIN OF t_temp OCCURS 0,
kunag LIKE vbrk-kunag,
vbeln_k LIKE vbrk-vbeln,
fkdat LIKE vbrk-fkdat,
knumv LIKE vbrk-knumv,
fkart LIKE vbrk-fkart,
vtweg LIKE vbrk-vtweg,
vkorg LIKE vbrk-vkorg,
vbeln LIKE likp-vbeln, "Delivery
vbeln_p LIKE vbrp-vbeln,
vstel LIKE vbrp-vstel,
"vgbel like mkpf-xblnr,
vgbel LIKE vbrp-vgbel,
aubel LIKE vbrp-aubel,
matnr LIKE vbrp-matnr,
arktx LIKE vbrp-arktx,
matkl LIKE vbrp-matkl,
fkimg LIKE vbrp-fkimg,
posnr LIKE vbrp-posnr,
vrkme LIKE vbrp-vrkme,
matnr_m LIKE mara-matnr,
mtart LIKE mara-mtart,
wrkst LIKE mara-wrkst,
extwg LIKE mara-extwg,
labor LIKE mara-labor,
normt LIKE mara-normt,
bismt LIKE mara-bismt,
spart LIKE mara-spart,
meins LIKE mara-meins,
kposn LIKE konv-kposn,
kschl LIKE konv-kschl,
kwert LIKE konv-kwert,
kwert1 LIKE konv-kwert,
kwert2 LIKE konv-kwert,
kwert3 LIKE konv-kwert,
kwert4 LIKE konv-kwert,
kwert5 LIKE konv-kwert,
kbetr LIKE konv-kbetr,
vbeln_kp LIKE mkpf-xblnr, " likp-vbeln,
lfdat LIKE likp-lfdat,
wgbez LIKE t023t-wgbez,
spras LIKE t023t-spras,
bsart LIKE ekko-bsart,
aedat LIKE ekko-aedat,
**********************modification additioon of chapter ID 30.04.2007
j_1ichid LIKE j_1imtchid-j_1ichid ,
**********************modification additioon of chapter ID 30.04.2007
total TYPE p DECIMALS 2,
mvgr1 LIKE mvke-mvgr1,
werks LIKE t001w-werks, "Number of the document condition
kunnr LIKE t001w-kunnr, "Condition value
name1 LIKE t001w-name1, "Condition type
name2 LIKE t001w-name2, "Condition item number
werks1 LIKE t001w-werks, "Number of the document condition
kunnr1 LIKE t001w-kunnr, "Condition value
name11 LIKE t001w-name1, "Condition type
name21 LIKE t001w-name2,
exnum LIKE j_1iexchdr-exnum, "Material Number
exdat LIKE j_1iexchdr-exdat, "Chapter ID
rdoc LIKE j_1iexchdr-rdoc,
bom TYPE p DECIMALS 4,
mult TYPE p DECIMALS 4,
bezie LIKE tvm1t-bezei,
length(5) TYPE n,
breath(5) TYPE n,
size(15) TYPE p DECIMALS 2,
area(15) TYPE p DECIMALS 2,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
budat TYPE mkpf-budat, "Posting period
END OF t_temp.
DATA : BEGIN OF it_mseg OCCURS 0,
werks LIKE mseg-werks,
matnr LIKE mseg-matnr,
ebeln LIKE mseg-ebeln,
mblnr TYPE mseg-mblnr, "Number of Material Document
mjahr TYPE mseg-mjahr, "Material Document Year
END OF it_mseg.
DATA : BEGIN OF it_mkpf OCCURS 0,
budat TYPE mkpf-budat,
mblnr TYPE mkpf-mblnr,
tcode2 LIKE mkpf-tcode2,
" xblnr(10) TYPE C,
xblnr LIKE likp-vbeln, "Delivery
END OF it_mkpf.
DATA : BEGIN OF it_vbuk OCCURS 0,
vbeln LIKE vbuk-vbeln,
wbstk LIKE vbuk-wbstk,
END OF it_vbuk.
DATA : it_vbrk LIKE t_vbrk OCCURS 0 WITH HEADER LINE.
DATA : it_vbrp LIKE t_vbrp OCCURS 0 WITH HEADER LINE.
DATA : it_mara LIKE t_mara OCCURS 0 WITH HEADER LINE.
TYPES : w_str TYPE string,
str TYPE string.
* WORK AREAS *
DATA: wa_vbrk LIKE t_vbrk. "WORK AREA FOR VBRK
DATA: wa_vbrp LIKE t_vbrp. "WORK AREA FOR VBRP
DATA: wa_mara LIKE t_mara. "WORK AREA FOR MARA
DATA: wa_sfinal LIKE t_temp. "WORK AREA FOR T_FINAL
DATA: wa_sfinal1 LIKE t_final. "WORK AREA FOR T_FINAL
DATA: wa_mseg LIKE it_mseg. "Workarea for internal table mseg
DATA : wa_vbeln LIKE t_vbrk-vbeln.
DATA: wa_mkpf LIKE it_mkpf. "Workarea for internal table mkpf
* ALV *
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
it_top_of_page TYPE slis_t_listheader,
ls_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event.
* SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK detail WITH FRAME TITLE text-000.
SELECT-OPTIONS: supp_pnt FOR vbrp-vstel OBLIGATORY. "SUPPLYING PLANT
SELECT-OPTIONS: recv_pnt FOR vbrk-kunag OBLIGATORY. "RECEIVING PLANT
SELECT-OPTIONS: period FOR vbrk-fkdat OBLIGATORY. "PERIOD
SELECT-OPTIONS: budat FOR mkpf-budat. " MIGO DATE
SELECTION-SCREEN END OF BLOCK detail.
* START-OF-SELECTION *
***********************************POPULATING DATA
PERFORM populating_data.
**********************************MOVE DATA
PERFORM move_data.
*********************************DATA- FETCHING
PERFORM data_fetching.
*********************************GET ALV DATA
PERFORM alv_get_data.
*********************************ALV GRID DATA
PERFORM alv_grid.
*********************************TOP OF PAGE
PERFORM top_of_page.
* VALIDATION OF SELECTION SCREEN *
AT SELECTION-SCREEN ON period.
IF period-high IS INITIAL.
MESSAGE e001(zamit).
ENDIF.
* SELECTION OF DATA *
FORM populating_data.
*************POPULATING DATA FROM VBRK
CLEAR t_vbrk.
REFRESH t_vbrk.
SELECT kunag
vbeln
fkdat
knumv
fkart
vtweg
vkorg
erzet
FROM vbrk INTO TABLE t_vbrk
WHERE kunag IN recv_pnt AND
fkdat IN period AND
fkart = 'JEX' OR
fkart = 'F8' AND
vtweg = '10' AND
vkorg = '1000'.
DELETE t_vbrk[] WHERE fkdat = '' .
DELETE t_vbrk[] WHERE fkdat NOT IN period.
DELETE t_vbrk[] WHERE kunag NOT IN recv_pnt.
IF t_vbrk[] IS INITIAL.
MESSAGE i002(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
DELETE t_vbrk WHERE fkdat NOT IN period.
*DATA: l_tabix TYPE sy-tabix. " declare the sy-tabix as local variable
*DATA: l_lines TYPE sy-tabix.
*DATA: l_index TYPE sy-tabix.
*"SORT T_VBRK DESCENDING BY vbeln.
*SORT T_VBRK ASCENDING BY vbeln fkart .
*DESCRIBE TABLE t_vbrk LINES l_lines . "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
*CHECK l_lines > 1. " check lines are greater than 1
*LOOP AT t_vbrk.
* l_tabix = sy-tabix. " assine Index of Internal Tables into local var l_tabix
* l_index = l_tabix + 1.
* IF t_vbrk-fkart = 'F8'. " loop on the temp table
*READ TABLE t_vbrk INTO wa_vbrk INDEX l_index. " read the temp table with index l_index
*IF sy-subrc = 0.
*CHECK t_vbrk-vbeln < wa_vbrk-vbeln .
* if sy-subrc = 0.
* t_vbrk-W_FLAG = 'X'.
* MODIFY t_vbrk TRANSPORTING W_FLAG.
*endif.
* endif.
*else.
* exit.
*endif.
*endloop.
*LOOP at t_vbrk.
*DELETE t_vbrk WHERE w_flag = 'X' .
*endloop.
*" change by kalika dated 28.06.2007
**" change by kalika dated 28.06.2007
*************POPULATING DATA FROM VBRP
IF t_vbrk[] IS NOT INITIAL.
CLEAR t_vbrp.
REFRESH t_vbrp.
SELECT vbeln
vstel
vgbel
aubel
matnr
arktx
matkl
fkimg
werks
posnr
vrkme
FROM vbrp INTO TABLE t_vbrp
FOR ALL ENTRIES IN t_vbrk
WHERE vbeln = t_vbrk-vbeln
AND vstel IN supp_pnt .
ENDIF.
IF sy-subrc <> 0.
MESSAGE i000(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
IF t_vbrp[] IS NOT INITIAL.
SELECT vbeln wbstk FROM vbuk
INTO TABLE it_vbuk FOR ALL ENTRIES IN
t_vbrp WHERE vbeln = t_vbrp-vgbel.
ENDIF.
"DELETE t_vbrp[] WHERE vstel NOT in supp_pnt. " by kalika
*************POPULATING DATA FROM MARA
it_vbrp[] = t_vbrp[].
" it_vbrp-vgbel1 = t_vbrp-vgbel.
"SORT it_vbrp BY matnr.
SORT t_vbrp BY vbeln.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING matnr . by kalika
* IF t_vbrp IS NOT INITIAL.
CLEAR t_mara.
REFRESH t_mara.
SELECT matnr
mtart
wrkst
extwg
labor
normt
bismt
matkl
spart
meins
FROM mara INTO TABLE t_mara
FOR ALL ENTRIES IN it_vbrp WHERE
matnr = it_vbrp-matnr .
* ENDIF.
*************POPULATING DATA FROM KONV
it_vbrk[] = t_vbrk[].
SORT it_vbrk BY knumv .
DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING knumv .
CLEAR t_konv.
REFRESH t_konv.
SELECT knumv
kposn
kschl
kwert
kbetr
FROM konv INTO TABLE t_konv
FOR ALL ENTRIES IN it_vbrk
WHERE knumv = it_vbrk-knumv.
DELETE t_konv WHERE
kschl <> 'ZR02'
AND kschl <> 'JEXP'
AND kschl <> 'JECS'
AND kschl <> 'DIFF'.
*************POPULATING DATA FROM LIKP
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY vgbel.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING vgbel . by kalika
CLEAR t_likp.
REFRESH t_likp.
SELECT vbeln
lfdat
bldat " NEW CHANGE
FROM likp INTO CORRESPONDING FIELDS OF TABLE t_likp
FOR ALL ENTRIES IN it_vbrp
WHERE vbeln = it_vbrp-vgbel.
*************POPULATING DATA FROM T023T
it_mara[] = t_mara[].
SORT it_mara BY matkl .
DELETE ADJACENT DUPLICATES FROM it_mara COMPARING matkl.
CLEAR t_t023t.
REFRESH t_t023t.
IF t_mara[] IS NOT INITIAL.
SELECT matkl
wgbez
spras
FROM t023t INTO TABLE t_t023t
FOR ALL ENTRIES IN it_mara
WHERE matkl = it_mara-matkl AND
spras = sy-langu.
ENDIF.
*************POPULATING DATA FROM EKKO
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY aubel.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING aubel. by kalika
CLEAR t_ekko.
REFRESH t_ekko.
SELECT ebeln
bsart
aedat
knumv
FROM ekko
INTO TABLE t_ekko
FOR ALL ENTRIES IN it_vbrp
WHERE ebeln = it_vbrp-aubel
AND bsart LIKE 'U%'.
************************delete invoice where it is being deleted from the system
*SELECT ebeln loekz
* FROM ekpo
* INTO CORRESPONDING FIELDS OF TABLE t_ekpo
* FOR ALL ENTRIES IN t_ekko
* WHERE ebeln = t_ekko-ebeln.
*DELETE t_ekpo WHERE loekz = 'L'.
*************POPULATING DATA FROM t001w
it_vbrp[] = t_vbrp[].
SORT it_vbrp BY werks.
" DELETE ADJACENT DUPLICATES FROM it_vbrp COMPARING werks . by kalika
CLEAR t_t001w.
REFRESH t_t001w.
SELECT werks
name1
kunnr
name2
FROM t001w INTO TABLE t_t001w
FOR ALL ENTRIES IN it_vbrp
WHERE werks = it_vbrp-werks .
it_vbrk[] = t_vbrk[].
SORT it_vbrk BY kunag.
DELETE ADJACENT DUPLICATES FROM it_vbrk COMPARING kunag .
CLEAR t_t001w2.
REFRESH t_t001w2.
SELECT werks
name1
kunnr
name2
FROM t001w INTO TABLE t_t001w2
FOR ALL ENTRIES IN it_vbrk
WHERE kunnr = it_vbrk-kunag .
*--------POPULATING DATA FROM MARM
SELECT matnr
meinh
umrez
umren FROM marm INTO TABLE t_marm
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr.
*********************POPULATING DATA FROM MVKE
CLEAR t_mvke.
REFRESH t_mvke.
SELECT matnr
mvgr1
FROM mvke INTO TABLE t_mvke
FOR ALL ENTRIES IN t_vbrp
WHERE matnr = t_vbrp-matnr .
*-----------------POPULATING DATA FROM TVM1T.
SELECT
mvgr1 bezei FROM tvm1t
INTO TABLE t_tvm1t FOR ALL ENTRIES IN t_mvke
WHERE mvgr1 = t_mvke-mvgr1.
**********************modification additioon of chapter ID 30.04.2007
*-----------------POPULATING DATA FROM j_1imtchid.
CLEAR t_j_1imtchid.
REFRESH t_j_1imtchid.
SELECT matnr
j_1ichid
FROM j_1imtchid INTO TABLE t_j_1imtchid
FOR ALL ENTRIES IN t_vbrp
WHERE matnr = t_vbrp-matnr .
*-----------------POPULATING DATA FROM j_1iexchdr.
CLEAR t_j_1iexchdr.
REFRESH t_j_1iexchdr.
SELECT exnum
exdat
rdoc
werks
trntyp
status
FROM j_1iexchdr INTO TABLE t_j_1iexchdr
FOR ALL ENTRIES IN t_vbrp
WHERE rdoc = t_vbrp-vbeln
AND werks = t_vbrp-werks
AND trntyp = 'DLFC' . " by kalika
DELETE t_j_1iexchdr WHERE status = 'R' . " by kalika
DELETE t_j_1iexchdr WHERE status = 'B' . " by kalika
SORT t_j_1iexchdr BY rdoc.
***************end of modification additioon of chapter ID 30.04.2007
******* start of modification kalika dated 19.06.2007
LOOP AT t_likp.
t_likp-vbeln_kp = t_likp-vbeln.
MODIFY t_likp.
ENDLOOP.
* SELECT budat mblnr xblnr tcode2
* FROM mkpf
* INTO CORRESPONDING FIELDS OF TABLE it_mkpf
* FOR ALL ENTRIES IN t_likp
* WHERE xblnr = t_likp-vbeln_kp
* AND tcode2 LIKE 'MIGO_GR'
* AND budat IN budat. "26.07.2007
SELECT ebeln mblnr FROM mseg
INTO CORRESPONDING FIELDS OF TABLE it_mseg
FOR ALL ENTRIES IN t_vbrp
WHERE ebeln = t_vbrp-aubel AND mblnr LIKE '5%'.
SELECT budat mblnr tcode2
FROM mkpf
INTO CORRESPONDING FIELDS OF TABLE it_mkpf
FOR ALL ENTRIES IN it_mseg
WHERE mblnr = it_mseg-mblnr
AND tcode2 LIKE 'MIGO_GR'
AND budat IN budat. "26.07.2007
*loop at it_mkpf.
*DELETE it_mkpf WHERE mblnr = '4'.
*MODIFY it_mkpf.
*ENDLOOP.
ENDFORM. "populating_data
* FORM MOVE_DATA. *
FORM move_data.
CLEAR t_final.
REFRESH t_final.
SORT : t_vbrp BY vbeln,
t_vbrk BY vbeln,
t_mara BY matnr,
t_likp BY vbeln,
t_ekko BY ebeln,
t_t023t BY matkl,
t_konv BY knumv,
t_mvke BY matnr,
t_t001w BY werks,
t_t001w2 BY kunnr,
t_tvm1t BY mvgr1,
t_j_1iexchdr BY rdoc,
t_j_1imtchid BY matnr,
t_j_1iexchdr BY rdoc werks,
" it_mkpf by mblnr,
it_mseg BY mblnr,
it_mkpf BY mblnr,
it_vbuk BY vbeln.
CLEAR t_vbrp.
LOOP AT t_vbrp.
t_final-vstel = t_vbrp-vstel.
t_final-vgbel = t_vbrp-vgbel.
t_final-aubel = t_vbrp-aubel.
t_final-matnr = t_vbrp-matnr.
t_final-arktx = t_vbrp-arktx.
t_final-matkl = t_vbrp-matkl.
t_final-fkimg = t_vbrp-fkimg.
t_final-posnr = t_vbrp-posnr.
t_final-vrkme = t_vbrp-vrkme.
" t_vbrp-vgbel1 = t_vbrp-vgbel.
READ TABLE it_vbuk WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
IF sy-subrc = 0.
t_final-flag = it_vbuk-wbstk.
ENDIF.
CLEAR t_vbrk.
READ TABLE t_vbrk WITH KEY vbeln = t_vbrp-vbeln
BINARY SEARCH.
IF sy-subrc = 0.
t_final-kunag = t_vbrk-kunag.
t_final-vbeln_k = t_vbrk-vbeln.
t_final-fkdat = t_vbrk-fkdat.
t_final-fkart = t_vbrk-fkart.
t_final-knumv = t_vbrk-knumv.
ENDIF.
CLEAR t_mara.
READ TABLE t_mara WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-mtart = t_mara-mtart.
t_final-wrkst = t_mara-wrkst.
t_final-extwg = t_mara-extwg.
t_final-labor = t_mara-labor.
t_final-normt = t_mara-normt.
t_final-bismt = t_mara-bismt.
t_final-spart = t_mara-spart.
t_final-meins = t_mara-meins.
SPLIT t_final-bismt AT '*' INTO t_final-length t_final-breath.
IF t_final-bismt = ''.
t_final-size = ''.
ELSE.
t_final-size = t_vbrp-fkimg * ( t_final-length * t_final-breath ) / 1000000.
ENDIF.
ENDIF.
CLEAR t_konv.
READ TABLE t_konv WITH KEY knumv = t_vbrk-knumv BINARY SEARCH.
IF sy-subrc = 0.
t_final-kschl = t_konv-kschl.
ENDIF.
CLEAR t_likp.
READ TABLE t_likp WITH KEY vbeln = t_vbrp-vgbel BINARY SEARCH.
IF sy-subrc = 0.
t_final-lfdat = t_likp-lfdat.
t_final-bldat = t_likp-bldat. " NEW CHANGE
t_final-vbeln_kp = t_likp-vbeln.
ENDIF.
CLEAR t_ekko.
READ TABLE t_ekko WITH KEY ebeln = t_vbrp-aubel BINARY SEARCH.
IF sy-subrc = 0.
t_final-aedat = t_ekko-aedat.
ENDIF.
CLEAR t_t023t.
READ TABLE t_t023t WITH KEY matkl = t_vbrp-matkl BINARY SEARCH.
IF sy-subrc = 0.
t_final-wgbez = t_t023t-wgbez.
ENDIF.
CLEAR t_t001w.
READ TABLE t_t001w WITH KEY werks = t_vbrp-werks BINARY SEARCH.
IF sy-subrc = 0.
t_final-name1 = t_t001w-name1.
ENDIF.
CLEAR t_t001w2.
READ TABLE t_t001w2 WITH KEY kunnr = t_vbrk-kunag BINARY SEARCH.
IF sy-subrc = 0.
t_final-name21 = t_t001w2-name2.
ENDIF.
READ TABLE t_mvke WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-mvgr1 = t_mvke-mvgr1.
ENDIF.
READ TABLE t_tvm1t WITH KEY mvgr1 = t_mvke-mvgr1 BINARY SEARCH.
IF sy-subrc = 0.
t_final-bezie = t_tvm1t-bezie.
ENDIF.
**********************modification additioon of chapter ID 30.04.2007
READ TABLE t_j_1imtchid WITH KEY matnr = t_vbrp-matnr BINARY SEARCH.
IF sy-subrc = 0.
t_final-j_1ichid = t_j_1imtchid-j_1ichid.
ENDIF.
READ TABLE t_j_1iexchdr WITH KEY rdoc = t_vbrp-vbeln
werks = t_vbrp-werks
BINARY SEARCH.
IF sy-subrc = 0.
t_final-exnum = t_j_1iexchdr-exnum.
t_final-exdat = t_j_1iexchdr-exdat.
t_final-rdoc = t_j_1iexchdr-rdoc.
t_final-werks = t_j_1iexchdr-werks.
ENDIF.
**************end of modification additioon of chapter ID 30.04.2007
"******** START OF MODIFICATION KALIKA 26.07.2007.
READ TABLE it_mseg INTO wa_mseg WITH KEY ebeln = t_vbrp-aubel.
IF sy-subrc = 0.
t_final-mblnr = wa_mseg-mblnr.
ENDIF.
"INTO wa_mkpf
READ TABLE it_mkpf WITH KEY mblnr = t_final-mblnr
tcode2 = 'MIGO_GR'.
IF sy-subrc = 0.
t_final-budat = it_mkpf-budat.
ENDIF.
APPEND t_final.
CLEAR t_final.
ENDLOOP.
DELETE t_final[] WHERE flag = 'A' OR flag = ''. "change by amit for reverse deliveries as rkp.
DELETE t_final WHERE fkdat = ' ' .
DELETE t_final[] WHERE kunag NOT IN recv_pnt.
DELETE t_final[] WHERE vstel NOT IN supp_pnt.
DELETE t_final[] WHERE fkart = 'JEX' AND exnum = ' '. " CHANGE BY KALIKA
" FOR INVOICE WHOSE EXCISE NOT MAINTAINED
IF t_final[] IS INITIAL.
MESSAGE i002(zamit).
LEAVE LIST-PROCESSING.
ENDIF.
*---------------MARM CALCULATION
SORT t_marm BY matnr meinh.
DELETE t_marm WHERE meinh = 'M2'.
SORT t_marm BY matnr.
LOOP AT t_final.
READ TABLE t_marm WITH KEY matnr = t_final-matnr." T_MARM-MEINH <> 'M2'.
t_final-bom = ( t_marm-umrez / t_marm-umren ).
MODIFY t_final TRANSPORTING bom.
t_final-mult = t_final-bom * t_final-fkimg.
MODIFY t_final TRANSPORTING mult.
CLEAR t_final.
ENDLOOP.
*--------------------delivery no.
*-------------------beginning of adding na*******
LOOP AT t_final.
" *** change by kalika
IF t_final-matkl EQ 'BWGRBBD'
OR t_final-matkl = 'BWGRBPD'
OR t_final-matkl = 'BWGRCLB'
OR t_final-matkl = 'BWGRCMD'
OR t_final-matkl = 'BWGRGFB'
OR t_final-matkl = 'BWGRGFC'
OR t_final-matkl = 'BWGRGFO'
OR t_final-matkl = 'GRNLAM'
OR t_final-matkl = 'DVNRTKBB'
OR t_final-matkl = 'MRETBBD'
OR t_final-matkl = 'MRGRBBD'
OR t_final-matkl = 'MRGRCMD'
OR t_final-matkl = 'MRRBBD'
OR t_final-matkl = 'PLAMGBSD'
OR t_final-matkl = 'BWETBBD'
OR t_final-matkl = 'PLAMGOSD'.
* "LOOP AT t_final WHERE matkl = 'BWGRBBD'
*OR matkl = 'BWGRBPD'
*OR matkl = 'BWGRCLB'
*OR matkl = 'BWGRCMD'
*OR matkl = 'BWGRGFB'
*OR matkl = 'BWGRGFC'
*OR matkl = 'BWGRGFO'
*OR matkl = 'GRNLAM'
*OR matkl = 'DVNRTKBB'
*OR matkl = 'MRETBBD'
*OR matkl = 'MRGRBBD'
*OR matkl = 'MRGRCMD'
*OR matkl = 'MRRBBD'
*OR matkl = 'PLAMGBSD'
*OR matkl = 'BWETBBD'
*OR matkl = 'PLAMGOSD'.
*** change by kalika
t_final-area = ( t_final-size * 15 ) / 10 .
MODIFY t_final TRANSPORTING area.
ELSE.
t_final-area = ( t_final-normt * t_final-size ) / 4. "t_final-bom
MODIFY t_final TRANSPORTING area.
ENDIF.
ENDLOOP.
"*** change by kalika
" ** start Division Specific FA & NA to be displayed by kalika
LOOP AT t_final.
IF t_final-spart = 'LM' .
t_final-area = space.
ENDIF.
IF t_final-spart = 'DD'.
t_final-area = space.
ENDIF.
MODIFY t_final.
ENDLOOP.
* " ** end Division Specific FA & NA to be displayed by kalika
* LOOP AT t_final WHERE matkl = 'BWETPLY'
* OR matkl = 'BWGRCHQ'
* OR matkl = 'BWGRCLP'
* OR matkl = 'BWGRCMG'
* OR matkl = 'BWGRFLX'
* OR matkl = 'BWGRFRP'
* OR matkl = 'BWGRGCP'
* OR matkl = 'BWGRPCT'
* OR matkl = 'BWGRPLY'
* OR matkl = 'BWGRSHT'
* OR matkl = 'MRGRPLY'
* OR matkl = 'MRTPLY'.
* t_final-area = ( t_final-normt * t_final-bom ) / 4.
* MODIFY t_final.
* ENDLOOP.
*-------------------ending of adding na**********
ENDFORM. " move_data.
* data_fetching *
FORM data_fetching.
*------ASSESSIBLE VALUE
SORT t_final BY knumv.
SORT t_konv BY knumv kposn.
CLEAR t_final.
CLEAR t_konv.
LOOP AT t_konv.
IF t_konv-kschl = 'ZR02'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert1 = t_konv-kwert.
t_final-kbetr = t_konv-kbetr.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert1 kbetr.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-----EXICESE
IF t_konv-kschl = 'JEXP'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert2 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert2.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-------CESS
IF t_konv-kschl = 'JECS'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert3 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert3.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
*-----ROUNDING
IF t_konv-kschl = 'DIFF'.
READ TABLE t_final WITH KEY knumv = t_konv-knumv posnr = t_konv-kposn.
t_final-kwert4 = t_konv-kwert.
IF sy-tabix <> 0.
MODIFY t_final INDEX sy-tabix TRANSPORTING kwert4.
CLEAR t_final.
CLEAR t_konv.
ENDIF.
ENDIF.
ENDLOOP.
****************TOTAL OF ALL VALUES
LOOP AT t_final.
t_final-total = t_final-kwert1 + t_final-kwert2 + t_final-kwert3 + t_final-kwert4.
MODIFY t_final INDEX sy-tabix TRANSPORTING total .
CLEAR t_final.
ENDLOOP.
*--------------delivery calculation.
" start change by kalika
DELETE t_final WHERE total = ' '. " BY KALIKA
" end change by kalika
LOOP AT t_final.
t_temp-vbeln_k = t_final-vbeln_k.
t_temp-vgbel = t_final-vgbel.
t_temp-fkart = t_final-fkart.
t_temp-kunag = t_final-kunag.
APPEND t_temp.
CLEAR t_temp.
ENDLOOP.
SORT t_temp DESCENDING BY vbeln_k .
SORT t_temp BY vgbel.
LOOP AT t_final.
READ TABLE t_temp WITH KEY vgbel = t_final-vgbel.
t_final-vbeln_k = t_temp-vbeln_k.
*---change by amit for validating migi date by amit
if t_final-budat = 0.
t_final-mblnr = ''.
endif.
*---change by amit for validating migi date by amit
MODIFY t_final TRANSPORTING vbeln_k mblnr.
CLEAR t_final.
ENDLOOP.
" start KALIKA 30.06.2007.
"SORT t_final STABLE DESCENDING by fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
SORT t_final STABLE ASCENDING BY fkart fkdat. "plz kalika do not forbid stable even it doent any effect this case but in future when large amount of data in production it will works.
DATA: l_tabix TYPE sy-tabix. " declare the sy-tabix as local variable
DATA: l_lines TYPE sy-tabix.
DATA: l_index TYPE sy-tabix.
DESCRIBE TABLE t_final LINES l_lines . "The current number of table rows of the internal table itab is determined and is assigned to the data object lin
CHECK l_lines > 1. " check lines are greater than 1
LOOP AT t_final WHERE fkart = 'F8'.
l_tabix = sy-tabix. " assine Index of Internal Tables into local var l_tabix
l_index = l_tabix + 1.
READ TABLE t_final INTO wa_sfinal1 INDEX l_index. " read the temp table with index l_index
IF sy-subrc = 0.
CHECK t_final-vgbel = wa_sfinal1-vgbel AND t_final-knumv NE wa_sfinal1-knumv.
IF sy-subrc = 0.
t_final-w_flag = 'X'.
MODIFY t_final TRANSPORTING w_flag.
ENDIF.
ENDIF.
ENDLOOP.
"DELETE ADJACENT DUPLICATES FROM t_final[] COMPARING fkart
DELETE t_final[] WHERE w_flag = 'X'.
" end KALIKA 30.06.2007.
*--change by amit for performa invoice deletion
DELETE t_final[] WHERE aedat = 0.
ENDFORM. " sub_CAL
* FORM ALV GET DATA FOR NOTIONAL AREA *
FORM alv_get_data .
CLEAR it_fieldcat.
***************** SUPPLYING PLANT
* wa_fieldcat-col_pos = '1'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'VSTEL'.
wa_fieldcat-seltext_m = 'SUPPLYING PLANT'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************** SUPPLYING PLANT
* wa_fieldcat-col_pos = '2'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-seltext_m = 'SUPP PLANT DESCRTN'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 20.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************** RECEIVING PLANT
* wa_fieldcat-col_pos = '3'. " ALV O/P COL-2
wa_fieldcat-fieldname = 'KUNAG'.
wa_fieldcat-seltext_m = 'RECEIVING PLANT'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************** RECEIVING PLANT
* wa_fieldcat-col_pos = '4'. " ALV O/P COL-2
wa_fieldcat-fieldname = 'NAME21'.
wa_fieldcat-seltext_m = 'RECE PLNT DESCRTN'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************** BILL NUMBER
* wa_fieldcat-col_pos = '5'. " ALV O/P COL-3
wa_fieldcat-fieldname = 'VBELN_K'.
wa_fieldcat-seltext_m = 'BILL NUMBER'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*******************BILL DATE
* wa_fieldcat-col_pos = '6'. " ALV O/P COL-4
wa_fieldcat-fieldname = 'FKDAT'.
wa_fieldcat-seltext_m = 'BILL DATE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** OUT BOUND DELIVERY NO
* wa_fieldcat-col_pos = '7'. " ALV O/P COL-5
wa_fieldcat-fieldname = 'VGBEL'.
wa_fieldcat-seltext_m = 'OUT BOUND DELIVERY NO'.
wa_fieldcat-just = 'L'.
* wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** OUT BOUND DELIVERY DATE
** wa_fieldcat-col_pos = '8'. " ALV O/P COL-6
* wa_fieldcat-fieldname = 'LFDAT'.
* wa_fieldcat-seltext_m = 'OUT BOUND DELIVERY DATE'.
* wa_fieldcat-just = 'L'.
* wa_fieldcat-tabname = 'T_FINAL'.
* wa_fieldcat-outputlen = 15.
* APPEND wa_fieldcat TO it_fieldcat.
* CLEAR wa_fieldcat.
" * wa_fieldcat-col_pos = '8'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'BLDAT'.
wa_fieldcat-seltext_m = 'DELIVERY DOC DATE'. " NEW CHANGE
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************* S.T.O. NO.
* wa_fieldcat-col_pos = '9'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'AUBEL'.
wa_fieldcat-seltext_m = 'S.T.O. NO.'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** S.T.O. DATE
* wa_fieldcat-col_pos = '10'. " ALV O/P COL-6
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_m = 'S.T.O. DATE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************ DIVISION
* wa_fieldcat-col_pos = '11'. " ALV O/P COL-7
wa_fieldcat-fieldname = 'SPART'.
wa_fieldcat-seltext_m = 'DIVISION'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
********** MATERIAL CODE
* wa_fieldcat-col_pos = '12'. " ALV O/P COL-9
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_m = 'MATERIAL CODE'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************ DESCRIPTION
* wa_fieldcat-col_pos = '13'. " ALV O/P COL-10
wa_fieldcat-fieldname = 'ARKTX'.
wa_fieldcat-seltext_m = 'DESCRIPTION'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************MATERIAL TYPE
* wa_fieldcat-col_pos = '14'. " ALV O/P COL-11
wa_fieldcat-fieldname = 'MTART'.
wa_fieldcat-seltext_m = 'MATERIAL TYPE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
************MATERIAL GROUP
* wa_fieldcat-col_pos = '15'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'MATKL'.
wa_fieldcat-seltext_m = 'MATERIAL GROUP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*******************modification additioon of chapter ID 30.04.2007
******************chapterID
* wa_fieldcat-col_pos = '32'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'J_1ICHID'.
wa_fieldcat-seltext_m = 'CHAPTER-ID'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '33'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'EXNUM'.
wa_fieldcat-seltext_m = 'EXCISE DOC.NO.'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '34'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'EXDAT'.
wa_fieldcat-seltext_m = 'EXCISE DOC.DATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************end of modification additioon of chapter ID 30.04.2007
*********SUB GROUP
* wa_fieldcat-col_pos = '16'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'MVGR1'.
wa_fieldcat-seltext_m = 'SUB GROUP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
* wa_fieldcat-col_pos = '16'. " ALV O/P COL-13
wa_fieldcat-fieldname = 'BEZIE'.
wa_fieldcat-seltext_m = 'SUB GROUP DISCRP'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************GROUP DISCRIPTION
* wa_fieldcat-col_pos = '17'. " ALV O/P COL-14
wa_fieldcat-fieldname = 'WGBEZ'.
wa_fieldcat-seltext_m = 'GROUP DISCRIPTION'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************FINISH
* wa_fieldcat-col_pos = '18'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'WRKST'.
wa_fieldcat-seltext_m = 'FINISH'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************sale u o m
* wa_fieldcat-col_pos = '19'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'VRKME'.
wa_fieldcat-seltext_m = 'SALE U O M'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************BASE u o m
* wa_fieldcat-col_pos = '19'. " ALV O/P COL-15
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-seltext_m = 'BASE U O M'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************DESIGN NO.
* wa_fieldcat-col_pos = '20'. " ALV O/P COL-17
wa_fieldcat-fieldname = 'EXTWG'.
wa_fieldcat-seltext_m = 'DESIGN NO.'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************CATEGORY
* wa_fieldcat-col_pos = '21'. " ALV O/P COL-18
wa_fieldcat-fieldname = 'LABOR'.
wa_fieldcat-seltext_m = 'CATEGORY'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************THICKNESS
* wa_fieldcat-col_pos = '22'. " ALV O/P COL-19.
wa_fieldcat-fieldname = 'NORMT'.
wa_fieldcat-seltext_m = 'THICKNESS'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************SIZE
* wa_fieldcat-col_pos = '23'. " ALV O/P COL-20.
wa_fieldcat-fieldname = 'BISMT'.
wa_fieldcat-seltext_m = 'SIZE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
****************BILLED QTY
* wa_fieldcat-col_pos = '24'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'FKIMG'.
wa_fieldcat-seltext_m = 'BILLED QTY'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************RETE
* wa_fieldcat-col_pos = '26'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'BOM'.
wa_fieldcat-seltext_m = 'CONVERSION RATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************MULT
* wa_fieldcat-col_pos = '32'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'MULT'.
wa_fieldcat-seltext_m = 'BILLED QTY IN BUM'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************RETE
* wa_fieldcat-col_pos = '25'. " ALV O/P COL-21.
wa_fieldcat-fieldname = 'KBETR'.
wa_fieldcat-seltext_m = 'RATE / BASE UOM'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
**************ASSESSIBLE VALUE
* wa_fieldcat-col_pos = '27'. " ALV O/P COL-22.
wa_fieldcat-fieldname = 'KWERT1'.
wa_fieldcat-seltext_m = 'ASSESSIBLE VALUE'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
****************EXCISE
* wa_fieldcat-col_pos = '28'. " ALV O/P COL-23.
wa_fieldcat-fieldname = 'KWERT2'.
wa_fieldcat-seltext_m = 'EXCISE'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*****************CESS
* wa_fieldcat-col_pos = '29'. " ALV O/P COL-24.
wa_fieldcat-fieldname = 'KWERT3'.
wa_fieldcat-seltext_m = 'CESS'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************ROUNDING
* wa_fieldcat-col_pos = '30'. " ALV O/P COL-26.
wa_fieldcat-fieldname = 'KWERT4'.
wa_fieldcat-seltext_m = 'ROUNDING'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************TOTAL
* wa_fieldcat-col_pos = '31'. " ALV O/P COL-27'.
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-seltext_m = 'TOTAL'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AREA'.
wa_fieldcat-seltext_m = 'NA'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MBLNR'.
wa_fieldcat-seltext_m = 'MIGO NO'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-seltext_m = 'MIGO DATE'.
wa_fieldcat-just = 'R'.
wa_fieldcat-tabname = 'T_FINAL'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " ALV_GET_DATA
* FORM ALV_GRID *
FORM alv_grid .
PERFORM fill_list_header USING it_top_of_page[].
PERFORM event-build USING gt_events[].
PERFORM fill_layout USING ls_layout.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ls_layout
it_fieldcat = it_fieldcat
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab -
Error:storage location for material's valuation type does not exit
create physical inventory document for material , it has a error message "Storage location X105 for material 0004AA00 plant 1151 valuation type **** does not exist", MMSC is ok, so i don't know what question?
Hi Yan,
If no previous goods movements have been posted yet for the combination of the relevant material, plant, storage location and valuation type the physical inventory cannot be done.
The table MCHB is used for both batch managed materials and materials with split valuation. You can only create a physical inventory document for a material with split valuation when both, a MARD and a MCHB segment are available.
When you create a valuation type in the material master, only the table MBEW is updated - an entry is not created in the table MCHB. This is needed however to perform a physical inventory for this material.
This MCHB segment is created when you perform a goods receipt for the material, but (like with batches) a physical inventory posting cannot create this entry in the table.
You will need to create a material posting for these materials if you wish to create a physical inventory for them. On the other hand, please, consider that it is not necessary to create a physical inventory for those materials which have not suffered any goods movement at all.
If you want to make a physical inventory for a material valuated separately, you have to proceed as follows:
- make a goods receipt (561)==> then the stock segment will be created
- make the reversal of the goods receipt
- make the inventory.
Hope this can help
Regards,
Mauro -
Hi, Finding fixed vendor for material
Hi,
my requirement is to copy the fixed vendor address to text object( available in the text tab of the VA01 transaction).
I am entering the article numbers in the va01 transaction with some 5 item numbers.
i am getting the Purchase requisition number(BANFN) and BNFPO( purchase req item number) from the VBEP table .
after getting the BANFN & BNFPO i have to pick the fixed vendor for the corresponding item number from EBAN.
EBAN is holding the values for only the last item number .
can u please tell me the internal table associated EBAN.
I am using the USEREXIT_SAVE_DOCUMENT from the include MV45AFZZ.
Is there any other way so that i can pick fixed vendor for an given article.?
Advance thanks
regards
paveee....Hi
try this
1) In sorce list fixed your vendor for material and plant combination ME01
2) for another source create info record for second vendor and material ,combination in ME11
Regards
Kailas ugale -
Need an IDOC EDI STEPS for material document(MB03)
HI ALL,
i need an IDOC for material document. For example, user in SAP make material document (t-code MIGO or MB11), then automatical is downloading outbound IDOC, which contain information about material document.HOW TO PROCESS IT THROUGH EDI .GIVE THE STEPS.like below you can do your settings
The EDI Configuration required to be done for Transfering IDoc to non SAP System is.
1. First of all, we need to identify the Transaction Data which is required to be Transfered to external System.(Ex: Sales Order Data or Shipment Data or Delivery Related Data).
2. Secondly, Identify the IDoc Type & Message Type. IDoc Type can be found in Transaction WE30 & Message Type Can be explored in Transaction WE81.
3. After that, assign the IDoc Type to Message Type in WE82.
4. Identify the Selection Program (Outbound) which is generally a Function Module in the Form of IDOC_OUTPUT_<Message Type>. Example, if the Message Type is ORDERS, the FM will be IDOC_OUTPUT_ORDERS.
5. Assign the Function Module to a Process Code in WE41 (Process Code for Outbound).
6. Configure Port Definitions in WE21 for which the RFC destinations are to be maintained in Transaction SM59.
7. Maintain Partner Profiles for the Outbound Message Processing in WE20.
8. Last, but not the Least, we need to Focus Mainly on Message Control Configuration which is nothing but maintaining the Output Type for the Outbound IDoc to be Triggered for the Sales Order Application or Delivery Application.
i. In Message Control Configuration, we'll maintain
a. Condition Tables
b. Access Sequences
c. Output Types
ii. To Create the above elements, we can go to SPRO Transaction and do the same depending on the Application Area such as Sales / Shipping / Logistics Execution etc.
iii. For Output Types & Access Sequences, we can go to the Transaction NACE or VK01 in which we'll maintain the Output Types / Access Sequences & Condition Records.
Please note that all the above steps may not be needed if we are using some of the Standard Elements provided by SAP such as Message Type, Process Code, IDoc Type & Selection Program as many of the Standard SAP Applications have their own Elements for different Application Areas.
For example, if you want to send an Order Confirmation IDoc when the Sales Order is saved, you can use the Message Type ORDRSP, IDoc Type ORDERS05 & Selection Program as IDOC_OUTPUT_ORDRSP.
However, Message Control Configuration is the Key Factor and is required for all the Applications as per the Customer's / Client's Requirements.
Maybe you are looking for
-
How to create a link to multiple links in pdf file
how to create a link to multiple links or a button to multiple links in pdf file. this links is goto diferent pages, no web. sorry for my english.
-
17 Inch G4 iMac displaying low quality grainy graphics on web pages
I'm having a very sudden problem with my iMac. Images on web pages are displaying very grainy and low quality. This is not an issue with images on my iPhoto or new images I upload from my digital camera. I have tried loading web pages on Safari, Fire
-
Address lookup (painfully) slow in Calendar (Mavericks)- can I disable it?
This new features seams really neat, but in reality it takes so long to find an address that I can barely type something into the event location field. As I start typing it starst hunting, and- I- have- to- wait- to- type- the- next- letter. I don't
-
IMac not Allowing Gigabit Connection
I just realized that my 2009 iMac isn't connecting at gigabit speeds. If I let the iMac automaticlly detect the connection it connects at 100BaseTX. I have an older Macbook too, and when plugged into the same cable it detects and connects at gigabit
-
This table contains no cards. Use Search to view cards
within communications express, when I go to compose a new message and click on the address book card to select recipients, it says: This table contains no cards. Use Search to view cards yet , when I go to address book I have entries in my personal a