Regarding basic data declaration
can anyone explain me what the following statement means and when we can use it.
DATA: A type ref to DATA.
Assing A ->* to <fs>.
As <fs> is a field symbol.
hi naveen,
DATA ref { {TYPE REF TO type}
| {LIKE REF TO dobj} }
[VALUE IS INITIAL]
[READ-ONLY].
Effect
Using the REF TO addition, you declare a reference variable ref. The specification after REF TO specifies the static type of the reference variables. The static type limits the set of objects to which ref can point. The dynamic type of a reference variable is the data type or the class to which it currently points. The static type is always more general or the same as the dynamic type (see also conversion rule for reference variables).
Syntax and meaning of the additions TYPE and LIKE are completely the same as the definition of reference types in the section TYPES -REF TO, but here they serve to create a bound reference type.
As a start value, only IS INITIAL can be specified after the addition VALUE.
Note
Reference variables are opak - that is, you cannot directly access their content. A reference is made up of the address of an object and other management information.
Example
In this example, an object reference oref and two data references dref1 and dref2 are declared. Both data references are typed fully and can be dereferenced using the dereferencing operator ->* at operand positions.
CLASS c1 DEFINITION.
PUBLIC SECTION.
DATA a1 TYPE i VALUE 1.
ENDCLASS.
DATA: oref TYPE REF TO c1,
dref1 LIKE REF TO oref,
dref2 TYPE REF TO i.
CREATE OBJECT oref.
GET REFERENCE OF oref INTO dref1.
CREATE DATA dref2.
dref2->* = dref1->*->a1.
FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
The FIELD-SYMBOLS statement declares a field symbol <fs>. The naming conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
You can use the addition typing to type the field symbol. The syntax of typing is described under Syntax of Typing. The typing specifies which memory areas can be assigned to the field symbol (see Checking the Typing) and in which operand positions it can be used.
You can omit the addition typing outside of methods. In this case, the field symbol has the complete generic type any and is implicitly assigned the predefined constant space during the declaration.
... STRUCTURE struc DEFAULT dobj
Effect
If you specify the addition STRUCTURE instead of typing for a field symbol, and struc is a local program structure (a data object, not a data type) or a flat structure from the ABAP Dictionary, this structure is cast for the field symbol <fs>. You have to specify a data object dobj that is initially assigned to the field symbol.
The field symbol copies the technical attributes of structure struc as if it were completely typed. When you assign a data object using the addition DEFAULT, or later using ASSIGN, its complete data type is not checked in non- Unicode programs. Instead, the system merely checks whether it has at least the length of the structure and its alignment.
In Unicode programs, we differentiate between structured and elementary data objects. For a structured data object dobj, its Unicode fragment view has to match the one of struc. In the case of an elementary data object, the object must be character-type and flat, and struc must be purely character-type. The same applies to assignments of data objects to field symbols typed using STRUCTURE when using the ASSIGN statement.
Field symbols declared using the addition STRUCTURE are a mixture of typed field symbols and a utility for casting structured data types. You should use the additions TYPE or LIKE for the FIELD-SYMBOLS statement to type field symbols, while the addition CASTING of the ASSIGN statement is used for casting.
Example
The first example shows the obsolete usage of the addition STRUCTURE.
DATA wa1 TYPE c LENGTH 512.
FIELD-SYMBOLS <scarr1> STRUCTURE scarr DEFAULT wa1.
<scarr1>-carrid = '...'.
The second example shows the replacement of STRUCTURE with the additions TYPE and CASTING.
DATA wa2 TYPE c LENGTH 512.
FIELD-SYMBOLS <scarr2> TYPE scarr.
ASSIGN wa2 TO <scarr2> CASTING.
<scarr2>-carrid = '...'.
reward points if helpful,
shylaja
Similar Messages
-
Regarding configuration of "Parameters for determining the basic dates"
Hi All,
Can anyone give inputs in which scenario we need to use the configuration "Parameters for determining the basic dates".
1)Do we have any restrictions for usage of above IMG configuration, 2) any pre-requisites to use the configuration of "Parameters for determining the basic dates" and 3)does configuration of this task is having any integration with any other modules, if yes what is the point of integration with other modules.
Thanks in advance.Dear Aditya,
Parameters for determining the basic dates in production order are used to calculate the Basic Start date & End date of Production order. It Determines if and how the basic dates or the dependent requirements dates are adjusted during lead time scheduling. You can customize this in OPU3 for planned order & OPU5 for Production Order.
There are the following possibilities:
1.The basic dates are adjusted and the dependent requirements are scheduled for the start dates of the relevant operations.
2.The basic dates are not adjusted and the dependent requirements are scheduled for the start dates of the relevant operations.
3.The basic dates are adjusted and the dependent requirements are scheduled for the order basic start date.
4.The basic dates are not adjusted and the dependent requirements are scheduled for the order basic start date.
1)Do we have any restrictions for usage of above IMG configuration
For scheduling this has to be. If you want that start date should be calculated based on Inhouse production time & not on routing select opetion 2 or 4
2) any pre-requisites to use the configuration of "Parameters for determining the basic dates"
Not as such
3)does configuration of this task is having any integration with any other modules
Not directly but with MM to determine dependent requirement Proposal.
Regards
ABhijit Gautam. -
Efficient or Better Ways for Data Declaration
Hi Guys,
Basically I've always programmed much the same way for a pretty long time now. Lately I've been asking myself the question - "how can i start improving on my tried and trusted ways".(oftern a linear programming approach). As part of this I'm examining ways to declare data better within in programs and to adopt a neat way to do so.
This may seem pretty trivial but the first question I want to ask is how to declare data better
e.g. I need to declare constants - each constant corresponds to a rule number; 1, 2,3,4,5,6 - 23 etc.
Instead of declaring the following line 23 times - is there a better way to declare in such a way.
Constants: c_rule_1 type c value '1' ,
c_rule_2 type c value '2',
etc etc etc
Your thoughts are greatly appreciated.
Thanks.
DK
Edited by: Damien Kesle on Nov 26, 2008 10:00 AMHi,
With my knowledge, data declarations for all constants with DATA comamnd itself is good practise in point of performance. Alternative is dynamic creation of variables. But it consumes more time and is not good to practise. Instead of crating individual parameters for each constant, you could create a structure and add all constants as fields as follows:
constants: begin of con,
1 type c value '1',
2 type c value '2',
end of con.
Regards,
Prasanth -
Basic date is not same with schedule dates
Hi,
I have a problem in MD04 stock requirement list.
Planned order basic date and schedule date is not the same.
The schedule date finish at year 2010 but basic date still end ad 2009
in MD04, the date display is basic date.
Why the basic date is not adjusted?
in configuration i had choosen adjust basic date in scheduling planned order.
In material master in house production time is not updated because we use lead time scheduling
Please kindly help
Best regards,
Freddy HaHi,
i omit the scheduling maergin key in material master,
the result of MRP is
BASIC DATES
Finish 15.10.2009
Start 14.10.2009
PRODUCTION DATES
15.02.2010 14:33:25
14.10.2009 07:00:00
scheduling type i planned order is still "backwards"
so in MD04 it is say that the goods is available at 15.10.2009 same with requirement dates.
this seem not right.
it seems that order finish date is not adjusted by lead time scheduling on "today scheduling".
Is there a way so order finish date is adjusted by lead time scheduling on "today scheduling" ????
Best regards,
Freddy Ha
Edited by: Freddy Halim on Oct 14, 2009 10:01 AM -
In material master How to add a new field on Basic data 1 view
Please Help It's very Urgent...
I have the Requirement that in Material Master a new field reqired to be added on basic data 1 view. This new field should be added just below field Old Material Number( MARA-BISMT).
Can anyone Please suggest the correct way to add the field as per above requirement.
I hope to get quick reply.
Thanks and Regards...
Tanweer ZakiNo need to validate all the other fields is no wear concerened with you, if you have any requirement to validate your field MVKE-LFMAX .
PROCESS BEFORE OUTPUT.
Verarbeitung vor der Ausgabe
MODULE INIT_SUB.
MODULE GET_DATEN_SUB.
MODULE FELDAUSWAHL.
MODULE SONDERFAUS.
MODULE SONFAUSW_IN_FGRUPPEN.
MODULE FAUSW_BEZEICHNUNGEN.
MODULE FELDHISTORIE.
MODULE BILDSTATUS.
MODULE ZUSREF_VORSCHLAGEN_B.
MODULE REFDATEN_VORSCHLAGEN.
MODULE ZUSREF_VORSCHLAGEN_A.
MODULE SET_DATEN_SUB.
PROCESS AFTER INPUT.
Verarbeitung nach der Eingabe
MODULE GET_DATEN_SUB.
CHAIN.
FIELD MVKE-LFMNG.
FIELD MVKE-AUMNG.
MODULE MVKE-LFMNG ON CHAIN-REQUEST.
ENDCHAIN.
FIELD MVKE-EFMNG.
FIELD MVKE-SCMNG.
FIELD MVKE-RDPRF.
CHAIN.
FIELD MVKE-SCHME.
MODULE MVKE-SCHME.
ENDCHAIN.
CHAIN.
FIELD MVKE-RDPRF.
MODULE MVKE-RDPRF.
ENDCHAIN.
<b>CHAIN." to validate your field
FIELD MVKE-LFMAX.
MODULE MVKE-LFMAX.
ENDCHAIN.</b>
MODULE SET_DATEN_SUB.
PROCESS ON VALUE-REQUEST.
Selbstprogrammierte Eingabehilfen
FIELD MVKE-SCHME MODULE MEALL_HELP.
FIELD MVKE-RDPRF MODULE MVKE-RDPRF_HELP.
<b>&----
*& Module MVKE-LFMAX INPUT
text
MODULE MVKE-RDPRF INPUT.
Validate check code
ENDMODULE. " MVKE-LFMAX INPUT</b>
Thanks and Regards,
Pavankumar -
Merging Basic data View and Classification View in Material Master
Hi,
There is a requirement to append Classification View under Basic Data View and then finally to delete Classification View.
As per my understanding, it is not possible. Please let me know if it is possible, if so, please let me know how is it possible.
A quick response is appreciated.
Thanks & Regards
Bhaskar BaddelaHi,
Refer the thread: Problem creating Material Master sales view with LSMW which discuss the same issue. You may check and revert back.
Regards,
AKPT -
We want only Division field Mandatory in Basic Data 1 View (T Code MM01)
Hi,
In Logistics u2013 General-> Material Master-> Field Selection-> Maintain Field Selection for Data Screens, for Field sel. group 90, we selected the Reqd Entry Option Button to make Division field in Basic Data 1 as mandatory.
Due to this fields like Sales unit, Unit of Measure Grp, DChain-spec. status etc. became Mandatory for T Code MM01
We want only Division field Mandatory.
Is there any way to create our own Field sel. Group where in we could assign the Fields we want to make mandatory?
Please guide.
Regards,Hi ,
Goto the Traansction code OMS9 and enter the FIELD SELECTION GROUP as 20 which is the field group for Division
now goto the details and in change mode you can find the FIELD like HIDE, OPTIONAL, DISPLAY , REQUIRED ENTRY
Chcek the radio button of Required field entry and save it
Now once you enter the MM01 , there you will find Division as Mandatory field
regards,
santosh -
How to Update the Basic Data text in Material Master.
Hi Abapers,
I have more than 5000 materials for update basic Data text inside Material Master.
how to update basic data text using abap programe? is there any bapi or normal program?.
anybody give me sample of this.
Thanks
S.Muthu.
IT Dept.Hi
You can do by using the FM SAVE_TEXT.
Just populate text into table i_tline.
Local data declaration
DATA: l_wa_thead TYPE thead, " Header
l_wa_tline TYPE tline. " Work area for tline
Populate header
l_wa_thead-tdobject = c_obj_material.
l_wa_thead-tdname = wa_data-matnr.
l_wa_thead-tdid = c_id_best.
l_wa_thead-tdspras = sy-langu.
l_wa_thead-tdluser = sy-uname.
l_wa_thead-tdfdate = sy-datum.
l_wa_thead-tdtxtlines = '1'.
IF i_tline[] IS NOT INITIAL.
l_wa_tline-tdformat = c_slash.
APPEND l_wa_tline TO i_tline.
ENDIF.
Text shd start from next line
l_wa_tline-tdformat = c_slash.
CONCATENATE c_text wa_data-text
INTO l_wa_tline-tdline SEPARATED BY space.
Append the new text to the int table
APPEND l_wa_tline TO i_tline and l_wa_thead
C* Local data declaration
DATA: l_wa_thead TYPE thead, " Header
l_wa_tline TYPE tline. " Work area for tline
Populate header
l_wa_thead-tdobject = c_obj_material.
l_wa_thead-tdname = wa_data-matnr.
l_wa_thead-tdid = c_id_best.
l_wa_thead-tdspras = sy-langu.
l_wa_thead-tdluser = sy-uname.
l_wa_thead-tdfdate = sy-datum.
l_wa_thead-tdtxtlines = '1'.
IF i_tline[] IS NOT INITIAL.
l_wa_tline-tdformat = c_slash.
APPEND l_wa_tline TO i_tline.
ENDIF.
Text shd start from next line
l_wa_tline-tdformat = c_slash.
CONCATENATE c_text wa_data-text
INTO l_wa_tline-tdline SEPARATED BY space.
Append the new text to the int table
APPEND l_wa_tline TO i_tline.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = l_wa_thead
savemode_direct = c_check
TABLES
lines = i_tline
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc = 0.
COMMIT WORK.
endif. -
Calculation of basic dates and schedule dates
I update material master from routing with CA97 to material master
work scheduling data with base quantity 1000
When MRP running, planned order for 54000 PCS is schedule with work scheduling data.
when i schedule planned order (change)
the calculation basic date & schedule date differs for 19 days
cause basic start shift
why is this happend?
is this cause by rounding when transforming minute from routing to days in material master?
is this because i used shift sequence and scheduling with breaks?
some strage case again is
for base qty 1000 processing time is 0.97
for base qty 10000 processing time is 6.93
is there any solution for this case?
please help.
Best regards,
Freddy Hai forgot i used overlapping
sorry -
Calculation of basic date and schedule date
I update material master from routing with CA97 to material master
work scheduling data with base quantity 1000
When MRP running, planned order for 54000 PCS is schedule with work scheduling data.
when i schedule planned order (change)
the calculation basic date & schedule date differs for 19 days
cause basic start shift
why is this happend?
is this cause by rounding when transforming minute from routing to days in material master?
is this because i used shift sequence and scheduling with breaks?
some strage case again is
for base qty 1000 processing time is 0.97
for base qty 10000 processing time is 6.93
is there any solution for this case?
please help.
Best regards,
Freddy Ha
Edited by: Freddy Halim on Jan 28, 2010 7:40 AMHi,
Yes. The schedule date is generated considering your factory calender also in addition to the routing data. For eg.. Suppose if Saturday and sunday are holidays, the schedule date will be extended to 2 days.
Pl. check the unit in your routing for the second query.
Pl. refer the link
http://help.sap.com/saphelp_47x200/helpdata/en/b1/c042b7439a11d189410000e829fbbd/frameset.htm
Madhava -
How to get the short text in tcode "msc3n" -- Basic data 2 -- short text.
I have to display the short text in my report output.
How to get the short text in tcode "msc3n" ( msc3n --> Basic data 2 --> short text.)?
Is there any function module availble to get this short text or is this stored in any data base table ?
Please help me. Your help will be highly appreaciated.
THANKS.Hi,
Use FM 'READ_TEXT' to get this values.
Say for exampele my material is 1900001 and batch is 0000000517.
Then my parameters to the FM will be as follows:-
Text Name 000000000001900001 0000000517
Language EN
Text ID VERM
Text Object CHARGE
This information you can get as follows.
Open the short text window in the text editor.
Here you can enter the long text.
In the editor Go to Header and you will find the details.
Please note that the text name will comprise of
Material
Batch
Plant
Stor. Location
if all the details are given.
I hope this helps you.
Regards,
Ankur Parab -
How is calculated SC current quantity in item basic data tab ?
Hello,
We work on a SRM 7 release with PPS.
As it is not possible in Extended Classic Scenario to use local contracts (that is not replicated into ECC backend) as sources of supply for "Limit" item Shopping Cart creation, we create "Free text" (Description) SC item.
For this kind of SC item, according to a specific and dedicated UoM, SC quantity is given as mandatory to be '1'. Then, users populate price. So, in this way, we have an "Amount" SC item being equivalent to standard "Limit" SC item.
Then, at corresponding PO item creation, SC item quantity ('1') is populated into PO item gross price and SC item gross price is populated into quantity PO item in order to be able to confirm in "quantity" our PO.
This process is OK.
Nevertheless, we have two sides effect after PO is generated :
1- Field "Current quantity" (not sure with the name - i do not have SRM system in front of me) for SC item basic data tab seems to be populated with value being difference between SC item quantity and PO item quantity.
For example, if SC item quantity is '1' and PO item quantity is '20.000' in SC item basic data, order quantity is '1' and ordered quantity is '20.000' with is normal. But "Current quantity" (below "Ordered quantity") is '19.999-' instead of '0'.
2- After a first confirmation created based on SC (not on PO, this is important), SC POWL button "Create confirmation" is greyed out. This seems to be normal behavior as PO item quantity confirmed first time can not be lower than 1, this confirmed quantity is greater than SC item quantity. So, there is no SC outsanding quantity...
Our two problems should be linked: this is due to how "Current quantity" for SC is calculated.
As our customer users do not have access to PO POWL, we can not use create Confirmation transaction in order to use PO as reference document to create confirmations.
In a technical point of view, field concerned is PS_SC_OUT_QUAN (not sure with this name...) for context ITEM_BASIC_DATA from view V_DODCSC_I_BD (WDC /SAPSRM/WDC_DODC_SC_I_BD ).
I found enhancement for this field ( /SAPPSRM/WD_SC_I_BD_QUAN ) but this enhancement has no method !
I tried to debug some methods from Class /SAPSRM/CL_CH_WD_SET_FACADE, but i did not find yet where calculation is done for concerned field.
My aim is to make an enhancement to overwrite standard calculation.
An easier way should be to reverse gross price and quantity directly inside SC (to not have difference betwen SC and PO quantities), but our customer does not want.
Do you have any idea ?
Regards.
Laurent.Hello,
We used a workaround to answer to our customer's requirement.
We ceated two customer fields, one for net price and a second one for the quantity. Using metadata, we hid the two corresponding standard fields and displayed our CUF in SC.
Using BadI Change for SC, we populated standard fields with our CUF values (after having made inversion between quantity / net price).
Checks are done in BAdI to be sure our quantity CUF and price unit values are '1'.
As we use SC to create only PO as follow-on document, no other modifications are necessary.
Regards.
Laurent. -
Data declaration error in adobe form
hi,
i m just remake a smartform into adobeform.but while doing so it's giving me error regarding data declaration.
I had declare some of internal table as type of defiened type but at code initialzation it giving it's not a internal table.
global data
it_abc type ty_abc,
types :
types: begin of ty_abc,
ab(8) type c,
bc(4) type c,
end of abc.
when i m creating a internal table in code initialization it's giving me that already declared.
code initialization.
data : it_abc type table of ty_abc.
Plz help me out.
Regards
RickyHi Maheshwari,
After the declaration of the TYPES Structure, you need to declare the Internal Table. As follows
TYPES
types: begin of ty_abc,
ab(8) type c,
bc(4) type c,
end of abc,
tt_abc type standard table of ty_abc initial size 0.
And in Global Declaration you use the newly created Internal Table (which is created using the Types Statement). And in Code Initialization you can use the Global Declaration internal table.
Regards
Pradeep Goli -
URGENT: REGARDING POSTING DATE AND DELETION OF ZEROS IN ALV REPORT
Hi,
I had made a report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as PERIOD :- _______ to _______ .
2nd problem is i had displayed the material no. ,but there are zeros which are displaying in dere ,i want to remove dem ... example, if the mat.no. is 2321 ,it is displaying 000002321. i want to remove these zeros.
Its request to all of u dat plz help me as fast as possible as it is most urgent to me and if any body provide me help he or sh e will be definately rewarded..
Regards,
ric.sHere i am giving you one of the ALV reports i have generated. Check this program. I hope it will be helpful to you.
REPORT ZFI_ASSIGNED_FUNDS_FINAL.
TABLES: FMIT,FMCIT,FPOS,IFMEISA1,FMFCTRT,BSEG,ZREV_BUDGET.
TYPE-POOLS: SLIS.
*ALV data declarations
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
GD_REPID LIKE SY-REPID.
*For ALV top of page
DATA : IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
*For ALV Events
DATA : IT_EVENT1 TYPE SLIS_T_EVENT.
*For ALV Events
DATA : IT_EVENT TYPE SLIS_ALV_EVENT.
*For top of page heading
DATA: IT_LINE TYPE SLIS_LISTHEADER.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : RADIO RADIOBUTTON GROUP R1.
IF RADIO EQ 'X'.
SELECT-OPTIONS: FIPEX FOR FPOS-FIPEX, " SELECTION FOR FUNDS CENTER & COMMITMENT ITEM
RFISTL FOR FMIT-RFISTL.
ENDIF.
PARAMETER: RADIO1 RADIOBUTTON GROUP R1.
IF RADIO1 EQ 'X'.
SELECT-OPTIONS : HKONT FOR BSEG-HKONT, " SELECTION FOR COST CENTER & G/L ACCOUNT
KOSTL FOR ZREV_BUDGET-KOSTL.
ENDIF.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: PERDE FOR IFMEISA1-PERDE DEFAULT '01' TO '12' OBLIGATORY.
PARAMETER : RYEAR LIKE FMIT-RYEAR OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.
DATA: BEGIN OF IT_TAB OCCURS 0,
FIKRS LIKE FMFCTR-FIKRS,
FICTR LIKE CSKS-KOSTL,
CTR_OBJNR LIKE FMFCTR-CTR_OBJNR,
RFISTL LIKE FMIT-RFISTL,
OBJNR LIKE BPPE-OBJNR,
END OF IT_TAB.
DATA: BEGIN OF IT_TAB1 OCCURS 0,
CO_OBJNR LIKE BPIJ-CO_OBJNR,
POSIT LIKE BPPE-POSIT,
FIPEX LIKE FMPOSIT-FIPEX,
FICTR LIKE FMFCTR-FICTR,
KSTAR LIKE COSP-KSTAR,
RFISTL LIKE FMIT-RFISTL,
OBJNR1 LIKE BPPE-OBJNR,
END OF IT_TAB1.
DATA: BEGIN OF IT_FMIT OCCURS 0,
RYEAR LIKE FMIT-RYEAR,
FIKRS LIKE FMIT-FIKRS,
RFISTL LIKE ZREV_BUDGET-KOSTL,
RFIPEX LIKE ZREV_BUDGET-KSTAR,
HSL01 LIKE FMIT-HSL01,
HSL02 LIKE FMIT-HSL02,
HSL03 LIKE FMIT-HSL03,
HSL04 LIKE FMIT-HSL04,
HSL05 LIKE FMIT-HSL05,
HSL06 LIKE FMIT-HSL06,
HSL07 LIKE FMIT-HSL07,
HSL08 LIKE FMIT-HSL08,
HSL09 LIKE FMIT-HSL09,
HSL10 LIKE FMIT-HSL10,
HSL11 LIKE FMIT-HSL11,
HSL12 LIKE FMIT-HSL12,
HSL13 LIKE FMIT-HSL13,
HSL14 LIKE FMIT-HSL14,
HSL15 LIKE FMIT-HSL15,
HSL16 LIKE FMIT-HSL16,
END OF IT_FMIT.
DATA: BEGIN OF IT_FMIT1 OCCURS 0,
RYEAR LIKE FMIT-RYEAR,
FIKRS LIKE FMIT-FIKRS,
RFISTL LIKE ZREV_BUDGET-KOSTL,
RFIPEX LIKE FMPG-FIPEX,
TOTAL LIKE FMIT-TSL01,
TOTAL1 LIKE FMIT-TSL01,
OBJNR LIKE BPPE-OBJNR,
POSIT LIKE BPPE-POSIT,
END OF IT_FMIT1.
DATA: BEGIN OF IT_BPPE OCCURS 0,
OBJNR LIKE BPPE-OBJNR,
POSIT LIKE BPPE-POSIT,
GJAHR LIKE BPPE-GJAHR,
WLP01 LIKE BPPE-WLP01,
WLP02 LIKE BPPE-WLP02,
WLP03 LIKE BPPE-WLP03,
WLP04 LIKE BPPE-WLP04,
WLP05 LIKE BPPE-WLP05,
WLP06 LIKE BPPE-WLP06,
WLP07 LIKE BPPE-WLP07,
WLP08 LIKE BPPE-WLP08,
WLP09 LIKE BPPE-WLP09,
WLP10 LIKE BPPE-WLP10,
WLP11 LIKE BPPE-WLP11,
WLP12 LIKE BPPE-WLP12,
END OF IT_BPPE.
DATA: BEGIN OF IT_BPPE1 OCCURS 0,
OBJNR LIKE BPPE-OBJNR,
POSIT LIKE BPPE-POSIT,
GJAHR LIKE BPPE-GJAHR,
RFISTL LIKE FMIT-RFISTL,
FIPEX LIKE FPOS-FIPEX,
TOTAL2 LIKE BPPE-WLP01,
END OF IT_BPPE1.
DATA: BEGIN OF IT_CSKS OCCURS 0,
KOKRS LIKE CSKS-KOKRS,
KOSTL LIKE CSKS-KOSTL,
BUKRS LIKE CSKS-BUKRS,
OBJNR LIKE CSKS-OBJNR,
END OF IT_CSKS.
DATA: BEGIN OF IT_COSP OCCURS 0,
OBJNR LIKE COSP-OBJNR,
GJAHR LIKE COSP-GJAHR,
KSTAR LIKE COSP-KSTAR,
BEKNZ LIKE COSP-BEKNZ,
WKG001 LIKE COSP-WKG001,
WKG002 LIKE COSP-WKG002,
WKG003 LIKE COSP-WKG003,
WKG004 LIKE COSP-WKG004,
WKG005 LIKE COSP-WKG005,
WKG006 LIKE COSP-WKG006,
WKG007 LIKE COSP-WKG007,
WKG008 LIKE COSP-WKG008,
WKG009 LIKE COSP-WKG009,
WKG010 LIKE COSP-WKG010,
WKG011 LIKE COSP-WKG011,
WKG012 LIKE COSP-WKG012,
END OF IT_COSP.
DATA: BEGIN OF IT_COSP2 OCCURS 0,
OBJNR LIKE COSP-OBJNR,
GJAHR LIKE COSP-GJAHR,
KSTAR LIKE COSP-KSTAR,
FIPEX LIKE FMPG-FIPEX,
TOTAL LIKE COSP-WKG001,
TOTAL1 LIKE COSP-WKG001,
OBJNR1 LIKE BPPE-OBJNR,
POSIT LIKE BPPE-POSIT,
END OF IT_COSP2.
IF RADIO EQ 'X'.
DATA: BEGIN OF IT_FINAL OCCURS 0,
FIKRS LIKE FMIT-FIKRS,
RFISTL LIKE FMIT-RFISTL,
RFIPEX LIKE FMIT-RFIPEX,
TEXT LIKE FMCIT-TEXT1,
ALLOC LIKE FMIT-TSL16,
USED LIKE FMIT-TSL16,
REMAIN LIKE FMIT-TSL16,
BEZEICH LIKE FMFCTRT-BEZEICH,
END OF IT_FINAL.
ENDIF.
IF RADIO1 EQ 'X'.
DATA: BEGIN OF IT_FINAL1 OCCURS 0,
GJAHR LIKE ZREV_BUDGET-GJAHR,
KOSTL LIKE ZREV_BUDGET-KOSTL,
KSTAR LIKE ZREV_BUDGET-KSTAR,
TOTAL1 LIKE COSP-WKG001,
TOTAL3 LIKE COSP-WKG001,
TEXT LIKE CSKU-KTEXT,
VARIANCE LIKE COSP-WKG001,
BEZEICH LIKE FMFCTRT-BEZEICH,
END OF IT_FINAL1.
ENDIF.
DATA: BEGIN OF IT_FISTL OCCURS 0,
RFISTL LIKE FMIT-RFISTL,
BEZEICH LIKE FMFCTRT-BEZEICH,
END OF IT_FISTL.
DATA: BEGIN OF IT_HKONT OCCURS 0,
KSTAR LIKE CSKU-KSTAR,
KTEXT LIKE CSKU-KTEXT,
END OF IT_HKONT.
DATA: PERIOD1 TYPE I,
PERIOD2 TYPE I,
PERIOD3 TYPE I,
PERIO TYPE I.
DATA: BEZEICH LIKE FMFCTRT-BEZEICH.
CONSTANTS: C_00 TYPE MONAT VALUE '00',
C_13 TYPE MONAT VALUE '13'.
DATA : IT_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
DATA: FIPEX1 LIKE COSP-KSTAR.
A T - S E L E C T I O N S C R E E N
AT SELECTION-SCREEN.
LOOP AT PERDE.
IF PERDE-LOW >= C_13 OR PERDE-HIGH >= C_13 .
MESSAGE E022(ZA) WITH 'Enter Period values from 1 to 12'.
EXIT.
ENDIF.
ENDLOOP.
IF NOT PERDE-LOW IS INITIAL.
PERIOD1 = PERDE-LOW.
ENDIF.
IF NOT PERDE-HIGH IS INITIAL.
PERIOD2 = PERDE-HIGH.
PERIOD3 = PERIOD2 - PERIOD1.
PERIOD3 = PERIOD3 + 1.
ELSE.
PERIOD3 = 1.
ENDIF.
PERIO = PERIOD1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-LOW.
SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FIKRS EQ 'NFFM'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'RFISTL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_FISTL
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO RFISTL-LOW.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-HIGH.
SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FIKRS EQ 'NFFM'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'RFISTL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_FISTL
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO RFISTL-HIGH.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-LOW.
SELECT KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
SORT IT_HKONT BY KSTAR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'HKONT'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_HKONT
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO HKONT-LOW.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-HIGH.
SELECT KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
SORT IT_HKONT BY KSTAR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'HKONT'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_HKONT
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO HKONT-HIGH.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-LOW.
SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FIKRS IN KOSTL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'KOSTL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_FISTL
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO KOSTL-LOW.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-HIGH.
SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FIKRS IN KOSTL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'KOSTL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = IT_FISTL
RETURN_TAB = IT_RETURN.
IF SY-SUBRC = 0.
READ TABLE IT_RETURN INDEX 1.
MOVE IT_RETURN-FIELDVAL TO KOSTL-HIGH.
ENDIF.
*START-OF-SELECTION
START-OF-SELECTION.
IF RADIO EQ 'X'. " FOR FUNDS CENTER AND COMMITMENT ITEM
PERFORM GET_DATA.
PERFORM PROCESS_DATA.
ENDIF.
IF RADIO1 EQ 'X'. " FOR COST CENTER AND G/L ACCOUNT
PERFORM GET_DATA1.
PERFORM PROCESS_DATA1.
ENDIF.
*END OF SELECTION
PERFORM BUILD_LAYOUT.
PERFORM BUILD_EVENTS.
IF RADIO EQ 'X'.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_SORT.
PERFORM DISPLAY_ALV_REPORT.
ENDIF.
IF RADIO1 EQ 'X'.
PERFORM BUILD_FIELDCATALOG1.
PERFORM BUILD_SORT1.
PERFORM DISPLAY_ALV_REPORT1.
ENDIF.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA .
SELECT FIKRS FICTR CTR_OBJNR INTO TABLE IT_TAB FROM FMFCTR
WHERE FIKRS EQ 'NFFM'
AND FICTR IN RFISTL.
SELECT CO_OBJNR POSIT INTO TABLE IT_TAB1 FROM BPIJ
FOR ALL ENTRIES IN IT_TAB
WHERE CO_OBJNR EQ IT_TAB-CTR_OBJNR.
LOOP AT IT_TAB1.
SELECT SINGLE FIPEX INTO IT_TAB1-FIPEX FROM FMPOSIT WHERE FIKRS EQ 'NFFM'
AND POSIT EQ IT_TAB1-POSIT
AND FIPEX IN FIPEX.
IF SY-SUBRC EQ '0'.
MODIFY IT_TAB1.
ELSE.
DELETE IT_TAB1.
ENDIF.
ENDLOOP.
SELECT OBJNR
POSIT
GJAHR
WLP01
WLP02
WLP03
WLP04
WLP05
WLP06
WLP07
WLP08
WLP09
WLP10
WLP11
WLP12
INTO TABLE IT_BPPE
FROM BPPE
FOR ALL ENTRIES IN IT_TAB1
WHERE OBJNR EQ IT_TAB1-CO_OBJNR
AND POSIT EQ IT_TAB1-POSIT
AND GJAHR EQ RYEAR
AND VORGA IN ('KBFR','KBUE','KBUS').
LOOP AT IT_BPPE.
MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
IT_BPPE1-RFISTL = IT_BPPE1-OBJNR+6(4).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_BPPE1-RFISTL
IMPORTING
OUTPUT = IT_BPPE1-RFISTL.
CALL FUNCTION 'FM_FIPEX_GET_FROM_POSIT'
EXPORTING
I_FIKRS = 'NFFM'
I_POSIT = IT_BPPE1-POSIT
IMPORTING
E_FIPEX = IT_BPPE1-FIPEX.
PERIOD1 = PERIO.
DO PERIOD3 TIMES.
CASE PERIOD1.
WHEN 1.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
WHEN 2.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
WHEN 3.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
WHEN 4.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
WHEN 5.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
WHEN 6.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
WHEN 7.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
WHEN 8.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
WHEN 9.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
WHEN 10.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
WHEN 11.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
WHEN 12.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
ENDCASE.
IF PERIOD2 >= PERIOD1.
PERIOD1 = PERIOD1 + 1.
ENDIF.
ENDDO.
COLLECT IT_BPPE1.
CLEAR PERIOD1.
CLEAR IT_BPPE1.
ENDLOOP.
SELECT RYEAR
FIKRS
RFISTL
RFIPEX
HSL01
HSL02
HSL03
HSL04
HSL05
HSL06
HSL07
HSL08
HSL09
HSL10
HSL11
HSL12
HSL13
HSL14
HSL15
HSL16
INTO TABLE IT_FMIT FROM FMIT
FOR ALL ENTRIES IN IT_BPPE1
WHERE RYEAR EQ RYEAR
AND FIKRS EQ 'NFFM'
AND RFIPEX EQ IT_BPPE1-FIPEX
AND RFIPEX IN FIPEX
AND RFISTL EQ IT_BPPE1-RFISTL.
LOOP AT IT_FMIT.
MOVE-CORRESPONDING IT_FMIT TO IT_FMIT1.
PERIOD1 = PERIO.
DO PERIOD3 TIMES.
CASE PERIOD1.
WHEN 1.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL01.
WHEN 2.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL02.
WHEN 3.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL03.
WHEN 4.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL04.
WHEN 5.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL05.
WHEN 6.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL06.
WHEN 7.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL07.
WHEN 8.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL08.
WHEN 9.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL09.
WHEN 10.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL10.
WHEN 11.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL11.
WHEN 12.
IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL12.
ENDCASE.
IF PERIOD2 >= PERIOD1.
PERIOD1 = PERIOD1 + 1.
ENDIF.
ENDDO.
IT_FMIT1-TOTAL1 = IT_FMIT1-TOTAL * -1 .
COLLECT IT_FMIT1.
CLEAR PERIOD1.
CLEAR IT_FMIT1.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA .
SORT IT_FMIT1 BY FIKRS RFISTL RFIPEX.
SORT IT_BPPE1 BY RFISTL FIPEX.
LOOP AT IT_BPPE1.
IT_FINAL-RFISTL = IT_BPPE1-RFISTL.
IT_FINAL-RFIPEX = IT_BPPE1-FIPEX.
IT_FINAL-ALLOC = IT_BPPE1-TOTAL2.
READ TABLE IT_FMIT1 WITH KEY RFISTL = IT_BPPE1-RFISTL RFIPEX = IT_BPPE1-FIPEX.
IF SY-SUBRC EQ 0.
IT_FINAL-USED = IT_FMIT1-TOTAL1.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFIPEX
IMPORTING
OUTPUT = IT_FMIT1-RFIPEX.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFISTL
IMPORTING
OUTPUT = IT_FMIT1-RFISTL.
Changes made on 13/11/2007 *******************************
SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
AND FIPEX EQ IT_FMIT1-RFIPEX.
SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
AND FIPEX EQ IT_BPPE1-FIPEX.
Changes made on 13/11/2007 *******************************
SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FICTR EQ IT_FMIT1-RFISTL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FINAL-RFIPEX
IMPORTING
OUTPUT = IT_FINAL-RFIPEX.
IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ENDLOOP.
SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
LOOP AT IT_FMIT1.
READ TABLE IT_FINAL WITH KEY RFISTL = IT_FMIT1-RFISTL RFIPEX = IT_FMIT1-RFIPEX.
IF SY-SUBRC NE 0.
IT_FINAL-RFISTL = IT_FMIT1-RFISTL.
IT_FINAL-RFIPEX = IT_FMIT1-RFIPEX.
IT_FINAL-USED = IT_FMIT1-TOTAL1.
IT_FINAL-ALLOC = '0'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFIPEX
IMPORTING
OUTPUT = IT_FMIT1-RFIPEX.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFISTL
IMPORTING
OUTPUT = IT_FMIT1-RFISTL.
SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
AND FIPEX EQ IT_FMIT1-RFIPEX.
SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FICTR EQ IT_FMIT1-RFISTL.
IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ELSE.
DELETE IT_FMIT1.
ENDIF.
ENDLOOP.
SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
ENDFORM. " PROCESS_DATA
*& Form GET_DATA1
text
--> p1 text
<-- p2 text
FORM GET_DATA1 .
SELECT KOKRS KOSTL BUKRS OBJNR INTO TABLE IT_CSKS
FROM CSKS
WHERE KOKRS EQ '1000'
AND KOSTL IN KOSTL
AND BUKRS EQ 'NFCL'.
SELECT OBJNR
GJAHR
KSTAR
BEKNZ
WKG001
WKG002
WKG003
WKG004
WKG005
WKG006
WKG007
WKG008
WKG009
WKG010
WKG011
WKG012
FROM COSP
INTO TABLE IT_COSP
FOR ALL ENTRIES IN IT_CSKS
WHERE OBJNR EQ IT_CSKS-OBJNR
AND GJAHR EQ RYEAR
AND KSTAR IN HKONT.
LOOP AT IT_COSP.
MOVE-CORRESPONDING IT_COSP TO IT_COSP2.
PERIOD1 = PERIO.
DO PERIOD3 TIMES.
CASE PERIOD1.
WHEN 1.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG001.
WHEN 2.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG002.
WHEN 3.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG003.
WHEN 4.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG004.
WHEN 5.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG005.
WHEN 6.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG006.
WHEN 7.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG007.
WHEN 8.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG008.
WHEN 9.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG009.
WHEN 10.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG010.
WHEN 11.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG011.
WHEN 12.
IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG012.
ENDCASE.
IF PERIOD2 >= PERIOD1.
PERIOD1 = PERIOD1 + 1.
ENDIF.
ENDDO.
IT_COSP2-OBJNR1 = IT_COSP2-OBJNR+10(6).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_COSP2-OBJNR1
IMPORTING
OUTPUT = IT_COSP2-OBJNR1.
CONCATENATE 'FSNFFM' IT_COSP2-OBJNR1 INTO IT_COSP2-OBJNR1.
IT_COSP2-FIPEX = IT_COSP2-KSTAR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_COSP2-FIPEX
IMPORTING
OUTPUT = IT_COSP2-FIPEX.
CALL FUNCTION 'FM_POSIT_GET_FROM_FIPEX'
EXPORTING
I_FIKRS = 'NFFM'
I_FIPEX = IT_COSP2-FIPEX
I_FLG_BUFFER_ALL =
IMPORTING
E_POSIT = IT_COSP2-POSIT
TABLES
T_FMPOSIT =
EXCEPTIONS
INPUT_ERROR = 1
DATA_NOT_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONDENSE IT_COSP2-OBJNR1.
CONDENSE IT_COSP2-POSIT.
COLLECT IT_COSP2.
CLEAR PERIOD1.
CLEAR IT_COSP2.
ENDLOOP.
SORT IT_COSP2 BY OBJNR KSTAR.
SELECT OBJNR
POSIT
GJAHR
WLP01
WLP02
WLP03
WLP04
WLP05
WLP06
WLP07
WLP08
WLP09
WLP10
WLP11
WLP12
INTO TABLE IT_BPPE
FROM BPPE
FOR ALL ENTRIES IN IT_COSP2
WHERE OBJNR EQ IT_COSP2-OBJNR1
AND POSIT EQ IT_COSP2-POSIT
AND GJAHR EQ RYEAR
AND VORGA IN ('KBFR','KBUE','KBUS').
LOOP AT IT_BPPE.
MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
PERIOD1 = PERIO.
DO PERIOD3 TIMES.
CASE PERIOD1.
WHEN 1.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
WHEN 2.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
WHEN 3.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
WHEN 4.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
WHEN 5.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
WHEN 6.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
WHEN 7.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
WHEN 8.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
WHEN 9.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
WHEN 10.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
WHEN 11.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
WHEN 12.
IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
ENDCASE.
IF PERIOD2 >= PERIOD1.
PERIOD1 = PERIOD1 + 1.
ENDIF.
ENDDO.
COLLECT IT_BPPE1.
CLEAR PERIOD1.
CLEAR IT_BPPE1.
ENDLOOP.
ENDFORM. " GET_DATA1
*& Form PROCESS_DATA1
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA1 .
LOOP AT IT_COSP2.
IT_FINAL1-GJAHR = IT_COSP2-GJAHR.
IT_FINAL1-KSTAR = IT_COSP2-KSTAR.
IT_FINAL1-TOTAL1 = IT_COSP2-TOTAL.
SELECT SINGLE KOSTL FROM CSKS INTO IT_FINAL1-KOSTL WHERE KOKRS = '1000'
AND BUKRS EQ 'NFCL'
AND OBJNR = IT_COSP2-OBJNR.
READ TABLE IT_BPPE1 WITH KEY OBJNR = IT_COSP2-OBJNR1 POSIT = IT_COSP2-POSIT.
IF SY-SUBRC EQ 0.
IT_FINAL1-TOTAL3 = IT_BPPE1-TOTAL2.
ENDIF.
SELECT SINGLE KTEXT INTO IT_FINAL1-TEXT FROM CSKU WHERE SPRAS EQ 'EN'
AND KSTAR EQ IT_COSP2-KSTAR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FINAL1-KOSTL
IMPORTING
OUTPUT = IT_FINAL1-KOSTL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FINAL1-KSTAR
IMPORTING
OUTPUT = IT_FINAL1-KSTAR.
SELECT SINGLE BEZEICH INTO IT_FINAL1-BEZEICH FROM FMFCTRT
WHERE SPRAS EQ 'EN'
AND FICTR EQ IT_FINAL1-KOSTL.
IT_FINAL1-VARIANCE = IT_FINAL1-TOTAL3 - IT_FINAL1-TOTAL1.
APPEND IT_FINAL1.
CLEAR IT_FINAL1.
ENDLOOP.
SORT IT_FINAL1 BY KOSTL KSTAR.
DELETE IT_FINAL1 WHERE KOSTL IS INITIAL.
ENDFORM. " PROCESS_DATA1
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG .
FIELDCATALOG-FIELDNAME = 'RFISTL'.
FIELDCATALOG-SELTEXT_M = 'Funds Center'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'BEZEICH'.
FIELDCATALOG-SELTEXT_M = 'Fund Center Description'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'RFIPEX'.
FIELDCATALOG-SELTEXT_M = 'Commitment Item'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'TEXT'.
FIELDCATALOG-SELTEXT_M = 'Commitment Item Description'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'ALLOC'.
FIELDCATALOG-SELTEXT_M = 'Allocated Budget'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'USED'.
FIELDCATALOG-SELTEXT_M = 'Used Budget'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'REMAIN'.
FIELDCATALOG-SELTEXT_M = 'Remaining Budget'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_FIELDCATALOG1
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG1 .
FIELDCATALOG-FIELDNAME = 'KOSTL'.
FIELDCATALOG-SELTEXT_M = 'Cost Center'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'BEZEICH'.
FIELDCATALOG-SELTEXT_M = 'Cost Center Description'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'KSTAR'.
FIELDCATALOG-SELTEXT_M = 'G/L Account'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'TEXT'.
FIELDCATALOG-SELTEXT_M = 'G/L Account Description'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'TOTAL3'.
FIELDCATALOG-SELTEXT_M = 'Planned amount'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'TOTAL1'.
FIELDCATALOG-SELTEXT_M = 'Actuals'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'VARIANCE'.
FIELDCATALOG-SELTEXT_M = 'Variance'.
FIELDCATALOG-DO_SUM = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATALOG1
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM BUILD_LAYOUT .
GD_LAYOUT-NO_INPUT = 'X'.
GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form BUILD_SORT
text
--> p1 text
<-- p2 text
FORM BUILD_SORT .
DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
GT_SORT-UP = 'X'.
GT_SORT-FIELDNAME = 'RFISTL'.
GT_SORT-TABNAME = 'IT_FINAL'.
GT_SORT-SUBTOT = 'X'.
APPEND GT_SORT TO GD_SORT.
CLEAR GT_SORT.
GT_SORT-UP = 'X'.
GT_SORT-FIELDNAME = 'BEZEICH'.
GT_SORT-TABNAME = 'IT_FINAL'.
APPEND GT_SORT TO GD_SORT.
CLEAR GT_SORT.
ENDFORM. " BUILD_SORT
*& Form BUILD_SORT1
text
--> p1 text
<-- p2 text
FORM BUILD_SORT1 .
DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
GT_SORT-UP = 'X'.
GT_SORT-FIELDNAME = 'KOSTL'.
GT_SORT-TABNAME = 'IT_FINAL'.
GT_SORT-SUBTOT = 'X'.
APPEND GT_SORT TO GD_SORT.
CLEAR GT_SORT.
GT_SORT-UP = 'X'.
GT_SORT-FIELDNAME = 'BEZEICH'.
GT_SORT-TABNAME = 'IT_FINAL'.
APPEND GT_SORT TO GD_SORT.
CLEAR GT_SORT.
ENDFORM. " BUILD_SORT1
*& Form BUILD_EVENTS
text
--> p1 text
<-- p2 text
FORM BUILD_EVENTS .
IT_EVENT-NAME = 'TOP_OF_PAGE'.
IT_EVENT-FORM = 'TOP_OF_PAGE'.
APPEND IT_EVENT TO IT_EVENT1.
CLEAR IT_EVENT.
ENDFORM. " BUILD_EVENTS
*& Form TOP_OF_PAGE
ALV TOP-OF-PAGE
FORM TOP_OF_PAGE. "#EC CALLED
REFRESH : IT_LIST_TOP_OF_PAGE.
CLEAR : IT_LINE.
IT_LINE-TYP = 'H'.
IT_LINE-INFO = TEXT-001.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR IT_LINE.
IF RADIO EQ 'X'.
IT_LINE-TYP = 'S'.
IT_LINE-INFO = TEXT-101.
IF NOT FIPEX-LOW IS INITIAL.
CONCATENATE TEXT-101 '-' FIPEX-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
IF NOT FIPEX-HIGH IS INITIAL.
CONCATENATE TEXT-101 '-' FIPEX-LOW 'to' FIPEX-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR IT_LINE-INFO.
IT_LINE-INFO = TEXT-102.
IF NOT RFISTL-LOW IS INITIAL.
CONCATENATE TEXT-102 '-' RFISTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
IF NOT RFISTL-HIGH IS INITIAL.
CONCATENATE TEXT-102 '-' RFISTL-LOW 'to' RFISTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
ENDIF.
IF RADIO1 EQ 'X'.
CLEAR IT_LINE-INFO.
IT_LINE-INFO = TEXT-105.
IF NOT KOSTL-LOW IS INITIAL.
CONCATENATE TEXT-105 '-' KOSTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
IF NOT KOSTL-HIGH IS INITIAL.
CONCATENATE TEXT-105 '-' KOSTL-LOW 'to' KOSTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR IT_LINE-INFO.
IT_LINE-INFO = TEXT-106.
IF NOT HKONT-LOW IS INITIAL.
CONCATENATE TEXT-106 '-' HKONT-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
IF NOT HKONT-HIGH IS INITIAL.
CONCATENATE TEXT-106 '-' HKONT-LOW 'to' HKONT-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
ENDIF.
CLEAR IT_LINE-INFO.
IT_LINE-INFO = TEXT-103.
IF NOT PERDE-LOW IS INITIAL.
CONCATENATE TEXT-103 '-' PERDE-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
IF NOT PERDE-HIGH IS INITIAL.
CONCATENATE TEXT-103 '-' PERDE-LOW 'to' PERDE-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CLEAR IT_LINE-INFO.
IT_LINE-INFO = TEXT-104.
IF NOT RYEAR IS INITIAL.
CONCATENATE TEXT-104 '-' RYEAR INTO IT_LINE-INFO SEPARATED BY SPACE.
ENDIF.
APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
ENDFORM. "TOP_OF_PAGE
*& Form DISPLAY_ALV_REPORT
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV_REPORT .
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IS_LAYOUT = GD_LAYOUT
IT_EVENTS = IT_EVENT1[]
IT_FIELDCAT = FIELDCATALOG[]
IT_SORT = GD_SORT[]
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "DISPLAY_ALV_REPORT
*& Form DISPLAY_ALV_REPORT1
text
--> p1 text
<-- p2 text
FORM DISPLAY_ALV_REPORT1 .
GD_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
IS_LAYOUT = GD_LAYOUT
IT_EVENTS = IT_EVENT1[]
IT_FIELDCAT = FIELDCATALOG[]
IT_SORT = GD_SORT[]
TABLES
T_OUTTAB = IT_FINAL1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSG -
Purchase order Text and Basic data text needed from MM03 tcode
Hi
I need Purchase order text and Basic data text to be fetched by material number.
Purchase order text and Basic data text are present in MM03 Tcode.
Can anyone please guide me how to do it.
Kind Regards
Sajidhi
Purchase order text
GotoMM03 ->view purchase order text.
In purchase order text screen, below you find one icon 'Editor'
click on this icon. It will open another screen.
In this screen -> click Goto Menu->Header.
It will open the details about Purchase order text.
TextName (Generally it is material name)
Language
Text ID : BEST
Text Object: MATERIAL.
Pass the above to READ_TEXT to get the text
*Basic data text *
Basic Data Text in MM03
Maybe you are looking for
-
How to create purchase order report form MM function module
Dear All, i need customized purchase order report with logo and grand total. regards, krishna
-
I need to upgrade CS4 to CS5.5 design premium Windows
After a system crash I had to reinstall CS4. We bought an upgrade to CS5.5 but I can't find the upgrade link.
-
Where to see activities, which are created for the campaign with target group
Hi I have created a Communication Method in SPRO -> CRM -> Marketing -> Marketing Planning & Campaign Management -> Campaign Executtion - Define Communication Method : Activity has been configured Activities are not appearing after creation of campai
-
OL7 uek issues after yum update to 3.10
I have been running Oracle Linux 7 uek (unbreakable) successfully for a few months, but I just did the update to 3.10 (latest kernel) and now I do not have the Unbreakable kernel anymore. The update copies it down and installs it but when the configu
-
Since i updated to Mavericks i have had 16 random restarts! What's going on?
My 13-inch, Mid 2012 MacBook Pro has randomly restarted since i updated to Mavericks. After 15 times it seemed to locate the problem - it had found a program that i never installed (Tuxler) that caused it to crash. The computer removed the files (tha