Update prps-posid
Hi all,
I'm having a problem with entries in the table PRPS. Someone entered data in the table with format BExx_100000.
After that, they activated a coding mask saying that the format must be BExx.10000.
Now we're receiving a shortdump when executing the search help saying that 10_00000 cannot be interpreted as a number. The coding mask has been already used, so we cannot delete the coding mask...
How can we proceed ?
thanks for the help !
Hey Neil,
thanks for the tip !
Luckely for us, we were not the only one who had this problem
SAP has a note (453280) were they include a program to solve issues like this. I ran program zzadjustposid which allowed us to adjust all posid's.
Sandly enough it was my functional colleague which had the idea to search for an Oss note, so that's something which I willhear for the next 3 months
Similar Messages
-
Hi,
I am updating DATE2 field of prps table with sys-date.
Can i do that using update command.
Wont it affect other functionality which are dependent on this table.
Thanks,
Sandeep GargHi Sandeep,
Yes you can update with UPDATE command.
update prps set date2 = sy-datum.
and it will affect only that time wherever this field is coming with standards programs tcodes.
make sure that the data in table is depend on this date or not.
just try this for one entry and see the result.
Thanks,
Sanket. -
Bapi function module to update PRPS table
Hi ,
Presently i have a requirement which needs to update some data from ZIOS table into PRPS table. Can any one tell me what is the Bapi function module for updating data into PRPS table.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Thanks,
Satish Raju
Edited by: Alvaro Tejada Galindo on Jan 12, 2010 11:46 AMThese ZZ fields are specific to your application, use the EXTENSION parameters.
Look in BAPI_PS_INITIALIZATION documentation, there is an explanation how-to fill specific fields.
For the BAPIs used to create and change project definitions, WBS
elements, networks, activities, and activity elements, you can
automatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVU
that have been defined for customer enhancements in the standard system.
For this purpose, help structures that contain the respective key
fields, as well as the CI include of the table are supplied. The BAPIs
contain the parameter ExtensionIN in which the enhancement fields can be
entered and also provide BAdIs in which the entered values can be
checked and, if required, processed further.
CI Include Help Structure Key
CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT
Procedure for Filling Standard Enhancements
Before you call the BAPI for each object that is to be created or
changed, for which you want to enter customer-specific table enhancemen
fields, add a data record to the container ExtensionIn:
o STRUCTURE: Name of the corresponding help structure
+o VALUEPART1: Key of the object + start of the data part+
o VALUEPART2-4: If required, the continuation of the data part
VALUPART1 to VALUPART4 are therefore filled consecutively, first with
the keys that identify the table rows and then with the values of the
customer-specific fields. By structuring the container in this way, it
is possible to transfer its content with one MOVE command to the
structure of the BAPI table extension.
Note that when objects are changed, all fields of the enhancements are
overwritten (as opposed to the standard fields, where only those fields
for which the respective update indicator is set are changed).
Therefore, even if you only want to change one field, all the fields
that you transfer in ExtensionIn must be filled.
You have to use these parameters in BAPI_BUS2054_GETDATA as well as in BAPI_BUS2054_CHANGE_MULTI.
Regards -
How to update PRPS Table?Is there any FM's available for it?
Hi,
I need to update two customized tables of PRPS table,These fields are present on any screen.How to modify the table entries with these values?
suppose my field name is docnum,and i want to add a document number directly to this table with out using any screen and user exit.Try this.
BAPI MAP2I_BAPI_BUS2054_CHG_TO_PRPS.
Yuvaram -
How to update one table from another table?
Hi,
Please go through the case I am mentioning below and if possible try to provide with a solution.
I am working on a report to generate cash flow forecast, where in one of the fields is "Payroll", in which its being mentioned as:
In the selection screen: I am entering Project ID, profit Center and Period(in MM/YYYY format).
Selection of all entries in table COSP for selected cost elements above, value type 1, version , all periods and for all selected WBS elements and all objects underneath.
From this, update table COFP with information from COSP with value type 62 and same period.
For updation of various fields the following information is being given.
How should we update COFP?
New entries per OBJNR/PERIO and HKONT are required via using the information from COSP:
COFP-MANDT = SY-MANDT
COFP-KOKRS = if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PKOKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-KOKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-KOKRS
COFP-BELNR = Check table NRIV, CLIENT = SY-MANDT, OBJECT = RK_BELEG,
SUBOBJECT = COFP-KOKRS, NRRANGENR = 05,
Add 1 to NRLEVEL and begin with 500000000
Use same BELNR for one update-run
COFP-BUZEI = 1 + and 1 in next entry but same update-run
COFP-TWAER = COSP-TWAER
COFP-ZHLDT = always last day of month in field COFP-PERIO
COFP-GJAHR = COSP-GJAHR
COFP-PERIO = if entry in field WKG001 à PERIO = 001
If entry in field WKG006 à PERIO = 006
COFP-WRTTP = 62
COFP-VRGNG = FIPL
COFP-POSIT = Check table SKB1 where SAKNR = COSP-KSTAR and use SKB1-FIPOS
for going to table FMCI-FIPOS and enter FMCI-POSIT
COFP-OBJNR = COSP-OBJNR
COFP-HKONT = COSP-KSTAR
COFP-WKGBTR = WKGXXX
COFP-WKGBTRO = -
COFP-WTGBTR = WTGXXX
COFP-WTGBTRO = -
COFP-WOGBTR = WTGXXX
COFP-WOGBTRO = -
COFP-BUKRS1 = -
COFP-GJAHR1 = -
COFP-BELNR1 = -
COFP-BUZEI1 = -
COFP-BUKRS2 = -
COFP-GJAHR2 = -
COFP-BELNR2 = -
COFP-BUZEI2 = -
COFP-EBELN = -
COFP-EBELP = -
COFP-ZEKKN = -
COFP-ETENRM = -
COFP-STUNR = -
COFP-LIFNR = -
COFP-KUNNR = -
COFP-GSBER = -
COFP-BUKRS = (nearly same as COFP-KOKRS!)
if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PBUKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-BUKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-BUKRS
COFP-EINDT = -
COFP-SGTXT = -
COFP-GEBER = -
COFP-KURSF = -
COFP-KUFIX = -
COFP-GBETR = -
COFP-KURSR = -
COFP-KURSFIKRS = -
COFP-KZKRS = -
COFP-UMBKZ = -
COFP-KBLNR = -
COFP-KBLPOS = -
COFP-HI FIVOR = -
COFP-LO FIVOR = -
COFP-HI ACCOUNT = -
COFP-LO ACCOUNT = -
COFP-HI LIFNR = -
COFP-LO LIFNR = -
COFP-HI KUNNR = -
COFP-LO KUNNR = -
COFP-XDELETE = -
COFP-HI XOPVW = -
COFP-LO XOPVW = -
COFP-ZAEHK = -
COFP-CHAINBELNR = -
COFP-MWSKZ = -
COFP-LEDNR = -
COFP-BELTP = 1
COFP-VERSN = 0
COFP-OWAER = COSP-TWAER
COFP-CPUDT = SY-DATUM
COFP-CPUTM = SY-TIME
after doing updation, its again saying Selection of all entries in table COFP with value type 51 to 62, selected year, selected cost elements above and for all selected WBS elements and all objects underneath. Summarisation by period.
Now, can someone help me as how to proceed with the entire thing? An elaborate and illustrative answer would be highly appreciable.
If you require any other information....then get back to me ..asap.
Its bit urgent.
Thanks & Regards,
RaviHi
update <table> from <i_tab>
for different conditions.
loop at i_cosp.
if cosp-mandt eq sy-mandt and cosp-objnr eq 'PR'.
Read table i_PRPS with key i_PRPS-OBJNR = i_COSP-OBJNR.
if sy-subrc eq 0.
update PRPS set PKOKR = ? where objnr = i_prpr-objnr.
endif.
endif.
similarly for all the conditions
Regards
Message was edited by: Harikishore Sreenivasulu -
Data retrieval from proj and prps tables
I want to retrieve the data from proj & prps by giving selection parameter as
project defination (proj-pspid). Please give me an idea about this. Is there any common field i between these two.
regardsHello,
Check this:
*--- Selektion von PSP-Elemente
SELECT PRPS~PSPNR PROJ~PSPID PRPS~POSID PRPS~POST1
PRPS~OBJNR PRPS~PSPHI
INTO TABLE G_T_PSP
FROM PRPS
JOIN PROJ ON PRPS~PSPHI = PROJ~PSPNR
WHERE PROJ~PSPID IN SO_PROJ
AND PROJ~LOEVM EQ SPACE
AND POSID IN SO_PSP
AND PRART IN SO_PRART
AND PRPS~LOEVM EQ SPACE
AND PRPS~PBUKR IN SO_PBUKR.
Regards,
Vasanth -
Hi all,
i have written a simple report :
SELECT PSPNR POSID USR11 FROM PRPS INTO CORRESPONDING FIELDS OF
TABLE LT_PRPS WHERE USR11 = 'X' .
i have kept break-point at the select statement..i have found one strange thing..values of PSPNR(in Debugging)
is showing as ' 00032880' for T-99822700.F002(actuall PRPS table value) and for POSID showing as ' T99822700F002' for T-99822700.F002(in Debugging)
..why it is showing internally like this..once i press F8(finish debugging) when i am getting actuall PRPS values...why internally it is showing some different values??
ThanksHi
This is due the coversion exit applicable at the field in PRPS table.
use Function module - conversion exit - CONVERSION_EXIT_ABPSN_OUTPUT for PRPS-POSID field
use Function module - conversion exit - CONVERSION_EXIT_ABPSP_OUTPUT for PRPS-PSPNR field
Regards
- Atul -
Validating Profit Center in CJ20N Transaction
Hi All,
My requirement is to lock the Profit Center field(Make it grayed out) in the project using CJ20n transaction once it is created.
Also when ever the user is trying to change the profit center by entering the project details, it should give an Error message saying that "the profit center value cannot be changed", when trying to save the project details with the new value.
I have tried using almost all the userexits(CNEX0001,CNEX0002,CNEX0003,CNEX0004,CNEX0005,CNEX0006,CNEX0007,CNEX0008,CNEX0038,CNEX0033,CNEX0028,CNEX0029) for the transaction CJ20n and even searched for the BADIs, but none of them was not suitable for my requirement.
Can any body suggest the suitable User exit or a BADI to implement for this requirement.
ThanksHello,
Try following....
Use BAdi BUS2054.
In that write an implementation
Two scenarios
1) Creating new project. (Values in PRPS table will get updated after save.)
2) Opening existing project in change mode. ( Already values corresponding to that WBSE are available in PRPS table).
Pre-Requisite:
1) If possible make Profit center field madatory.
Scenario 1:
In Implementation write
At_save
IF PRPS-PRCTR = initial or zero. Then no error. Because he is creating Project, so no values will be available in PRPS. Once he saves PRPS will get updated and from next it will be delt as per scenario 2 below.
Scenario 2:
At_save
If PRPS-PRCTR <> the value entered by the user (i.e. user trying to enter something different which is already there in PRPS table against that WBSE (PRPS-POSID)) throw an error "Profit center can not be changed".
Please try along with ur abaper.
Post ur findings.
Thanks & Regards
Saikishore.Ganga -
Very urgent- find parent-child relationship for wbs element
Hi,
There is a certain parent child heirachy in WBS elements.My requiremnet is to delete WBS element depending on certain field , say depending on some ""status"".If the status is active in some or any of the child then I am not suppose to delete its respective parent too. This parent-child relation can have say 5 levels.
For this I require a logic /program which shall maintain the parent reference for that particular child whih I want/ dont want to delete.
I am maintaining bottom- to -top approach.
That is I shall be checking for the status of the lowest level of WBS and then going to the highest.
Please Help!
Kshitijahi you can use following code....
REPORT zpmgmt_rpt_projinfo NO STANDARD PAGE HEADING LINE-SIZE 160.
*& Includes
INCLUDE <icon>.
INCLUDE zdata_declare_n. " include for data declaration
INCLUDE zsubr_n. " include for both subroutines
DATA: gv_index LIKE sy-tabix,
lv_index LIKE sy-tabix,
date_index TYPE sy-tabix.
*& Start of Selection ( Get Data )
START-OF-SELECTION.
For initial display cnt is set to X
IF cnt EQ 'X'.
PERFORM getdata.
CLEAR it_final.
PERFORM hierarchy.
cnt = ''.
ENDIF.
*& Form GETDATA
Fetches the data and logic for T1 and T2
--> p1 text
<-- p2 text
FORM getdata.
Getting project header data
SELECT * FROM proj
INTO CORRESPONDING FIELDS OF TABLE it_proj
WHERE pspid IN so_posid
AND werks IN so_plant
AND stort IN so_loc
AND erdat IN so_date.
IF sy-subrc <> 0.
MESSAGE 'Enter the valid entry' TYPE 'I'.
STOP.
ENDIF.
LOOP AT it_proj.
PROJECT = it_proj-pspid.
Get project & WBS element details
BAPI used gives the output in some specific format
which is used for roll-up logic.
CALL FUNCTION 'BAPI_PROJECT_GETINFO'
EXPORTING
project_definition = project
with_activities = 'X'
IMPORTING
e_project_definition = e_project_definition
TABLES
e_wbs_hierarchie_table = e_wbs_hierarchie_table.
Appending all the projects in the e_wbs.
LOOP AT e_wbs_hierarchie_table.
MOVE-CORRESPONDING e_wbs_hierarchie_table TO e_wbs.
APPEND e_wbs.
CLEAR e_wbs.
ENDLOOP.
CLEAR PROJECT.
ENDLOOP.
SET COUNTRY 'US'.
i_repid = sy-repid.
Getting data into internal tables
Getting project WBS element
SELECT * FROM prps
INTO CORRESPONDING FIELDS OF TABLE it_prps
FOR ALL ENTRIES IN it_proj
WHERE psphi = it_proj-pspnr.
Getting project activities
SELECT * FROM afvc
INTO CORRESPONDING FIELDS OF TABLE it_afvc
FOR ALL ENTRIES IN it_prps
WHERE projn = it_prps-pspnr.
SORT it_afvc BY vornr.
Getting activities start & end dates from AFVV
SELECT * FROM afvv
INTO CORRESPONDING FIELDS OF TABLE it_afvv
FOR ALL ENTRIES IN it_afvc
WHERE aufpl = it_afvc-aufpl
AND aplzl = it_afvc-aplzl.
Getting plant name
SELECT * FROM t001w
INTO CORRESPONDING FIELDS OF TABLE it_t001w
FOR ALL ENTRIES IN it_proj
WHERE werks = it_proj-werks.
Logic for passing data to final internal table
Passing Project master data
READ TABLE it_proj INDEX 1.
IF sy-subrc EQ 0.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
input = it_proj-pspid
IMPORTING
output = it_proj-pspid.
it_final-posid = it_proj-pspid.
it_final-post1 = it_proj-post1.
APPEND it_final.
CLEAR it_final.
ENDIF.
Passing WBS element to the final internal table IT_FINAL
LOOP AT it_prps.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
input = it_prps-posid
IMPORTING
output = it_prps-posid.
CLEAR color.
Get WBS element status ans color(T2)from OBJNR
CALL FUNCTION 'ZGET_STATUS_N'
EXPORTING
objnr = it_prps-objnr
IMPORTING
color = color
TABLES
t_status = it_tj30t.
IF color = 'RED'.
it_final-t2 = '@0A@'.
ELSEIF color = 'YELLOW'.
it_final-t2 = '@09@'.
ELSEIF color = 'GREEN'.
it_final-t2 = '@08@'.
ENDIF.
SORT it_tj30t DESCENDING.
Getting User statuses of WBS element at component level.
READ TABLE it_tj30t INDEX 1.
IF sy-subrc EQ 0.
CONCATENATE it_tj30t-txt04 '' INTO it_final-txt04 SEPARATED BY space.
ENDIF.
READ TABLE it_tj30t INDEX 2.
IF sy-subrc EQ 0.
CONCATENATE it_tj30t-txt04 it_final-txt04 INTO it_final-txt04 SEPARATED BY space.
ENDIF.
MOVE-CORRESPONDING it_prps TO it_final.
READ TABLE it_proj WITH KEY pspid = it_prps-posid.
IF sy-subrc EQ 0.
it_final-werks = it_proj-werks.
ENDIF.
APPEND it_final.
CLEAR it_final-txt04.
Passing activity to the final internal table IT_FINAL
LOOP AT it_afvc WHERE projn EQ it_prps-pspnr.
CLEAR color.
Getting user status and color(T2) for Activity from OBJNR
CALL FUNCTION 'ZGET_STATUS_N'
EXPORTING
objnr = it_afvc-objnr
IMPORTING
color = color
TABLES
t_status = it_tj30t.
IF color = 'RED'.
it_final-t2 = '@0A@'.
ELSEIF color = 'YELLOW'.
it_final-t2 = '@09@'.
ELSEIF color = 'GREEN'.
it_final-t2 = '@08@'.
ENDIF.
CLEAR: it_final-fsavd,
it_final-fssad.
MOVE-CORRESPONDING it_afvc TO it_final.
Getting User statuses of WBS element at activity level.
SORT it_tj30t DESCENDING.
READ TABLE it_tj30t INDEX 1.
IF sy-subrc EQ 0.
CONCATENATE it_tj30t-txt04 '' INTO it_final-txt04 SEPARATED BY space.
ENDIF.
READ TABLE it_tj30t INDEX 2.
IF sy-subrc EQ 0.
CONCATENATE it_tj30t-txt04 it_final-txt04 INTO it_final-txt04 SEPARATED BY space.
ENDIF.
APPEND it_final.
lv_index = sy-tabix.
CLEAR it_final-txt04.
CLEAR it_final-ltxa1.
CLEAR it_tj30t.
REFRESH it_tj30t.
Start Date and End Date fetched from AFVV.
LOOP AT it_afvv WHERE aufpl EQ it_afvc-aufpl
AND aplzl EQ it_afvc-aplzl.
MOVE-CORRESPONDING it_afvv TO it_final.
MODIFY it_final INDEX lv_index TRANSPORTING fsavd fssad.
ENDLOOP.
CLEAR it_afvc.
CLEAR lv_index.
ENDLOOP.
ENDLOOP.
Logic for T1.
T1 is based on T2 and start date and end date of activities.
LOOP AT it_final WHERE stufe = 3
AND ltxa1 IS NOT INITIAL.
gv_index = sy-tabix.
PERFORM date_difference.
CASE it_final-t2.
WHEN '@0A@'. " If Red
IF sy-datum GT it_final-fssad.
it_final-t1 = '@0A@'.
ELSEIF sy-datum LE it_final-fssad AND
sy-datum GE it_final-fsavd.
IF gv_diff > 1.
PERFORM date_monitor.
ENDIF.
it_final-t1 = '@09@'.
ELSEIF
sy-datum LT it_final-fsavd.
it_final-t1 = '@08@'.
ENDIF.
WHEN '@09@'. " If Yellow
IF sy-datum GT it_final-fssad.
it_final-t1 = '@0A@'.
ELSEIF sy-datum LE it_final-fssad AND
sy-datum GE it_final-fsavd.
IF gv_diff > 1.
PERFORM date_monitor.
ENDIF.
it_final-t1 = '@09@'.
ELSEIF
sy-datum LT it_final-fsavd.
it_final-t1 = '@08@'.
ENDIF.
WHEN '@08@'. " If Green
it_final-t1 = '@08@'.
ENDCASE.
MODIFY it_final INDEX gv_index TRANSPORTING t1.
CLEAR gv_index.
ENDLOOP.
ENDFORM. " GETDATA
*& Form hierarchy
Displays the data in ALV hierarchical manner.
In coding 3 tables are used for roll-up functionality.
FORM hierarchy .
DATA: it_final1 LIKE it_final OCCURS 0 WITH HEADER LINE.
DATA: it_final2 LIKE it_final OCCURS 0 WITH HEADER LINE.
DATA: it_final3 LIKE it_final OCCURS 0 WITH HEADER LINE.
DATA: count TYPE i VALUE 1.
DATA: posid LIKE prps-posid.
DATA: change,
date_mask TYPE c LENGTH 10,
lv_index2 LIKE sy-tabix.
DATA: index TYPE sy-tabix.
DATA: up LIKE prps-posid.
Deleting duplicate entries from the it_final.*****************
DELETE ADJACENT DUPLICATES FROM it_final.
LOOP AT it_final WHERE stufe EQ 2.
IF posid NE it_final-posid.
posid = it_final-posid.
ELSE.
DELETE it_final INDEX sy-tabix.
ENDIF.
ENDLOOP.
CLEAR posid.
LOOP AT it_final WHERE stufe EQ 3
AND ltxa1 EQ space.
IF posid NE it_final-posid.
posid = it_final-posid.
ELSE.
DELETE it_final INDEX sy-tabix.
ENDIF.
ENDLOOP.
Updating a new intrnal table for roll up functionality. ********
it_final1[] = it_final[].
CLEAR: lv_index2.
LOOP AT it_final1 WHERE stufe = 3
AND ltxa1 IS NOT INITIAL.
READ TABLE it_final WITH KEY stufe = 3
posid = it_final1-posid
post1 = it_final1-post1.
clear change.
IF sy-subrc = 0.
lv_index = sy-tabix.
IF lv_index2 <> lv_index.
CLEAR: change.
lv_index2 = lv_index.
ENDIF.
IF it_final1-t1 = '@0A@'.
it_final-t1 = '@0A@' .
MODIFY it_final INDEX lv_index TRANSPORTING t1.
DELETE it_final1 WHERE posid = it_final-posid.
CONTINUE.
ENDIF.
IF it_final1-t1 = '@09@'.
it_final-t1 = '@09@'.
change = 'Y'.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
CONTINUE.
ENDIF.
IF it_final1-t1 = '@08@'.
it_final-t1 = '@08@' .
IF change IS INITIAL.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
ENDIF.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
it_final2[] = it_final[].
CLEAR: lv_index2.
LOOP AT it_final2 WHERE stufe = 3
AND ltxa1 IS INITIAL.
READ TABLE e_wbs WITH KEY wbs_element = it_final2-posid.
IF sy-subrc = 0.
READ TABLE it_final WITH KEY stufe = 2
posid = e_wbs-up.
IF sy-subrc = 0.
CHECK it_final-t1 <> '@0A@'.
lv_index = sy-tabix.
IF lv_index2 <> lv_index.
CLEAR: change.
lv_index2 = lv_index.
ENDIF.
IF it_final2-t1 = '@0A@'.
it_final-t1 = '@0A@' .
MODIFY it_final INDEX lv_index TRANSPORTING t1.
CONTINUE.
ENDIF.
IF it_final2-t1 = '@09@'.
it_final-t1 = '@09@'.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
change = 'Y'.
CONTINUE.
ENDIF.
IF it_final2-t1 = '@08@'.
it_final-t1 = '@08@' .
IF change IS INITIAL.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
ENDIF.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
it_final3[] = it_final[].
CLEAR: lv_index2.
CLEAR change.
LOOP AT it_final3 WHERE stufe = 2.
READ TABLE e_wbs WITH KEY wbs_element = it_final3-posid.
CHECK sy-subrc = 0.
READ TABLE it_final WITH KEY stufe = 1
posid = e_wbs-up.
IF sy-subrc = 0.
CHECK it_final-t1 <> '@0A@'.
lv_index = sy-tabix.
IF lv_index2 <> lv_index.
CLEAR: change.
lv_index2 = lv_index.
ENDIF.
IF it_final3-t1 = '@0A@'.
it_final-t1 = '@0A@' .
MODIFY it_final INDEX lv_index TRANSPORTING t1.
DELETE it_final3. " WHERE stufe = 2.
CONTINUE.
ENDIF.
IF it_final3-t1 = '@09@'.
it_final-t1 = '@09@'.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
change = 'Y'.
CONTINUE.
ENDIF.
IF it_final3-t1 = '@08@'.
it_final-t1 = '@08@' .
IF change IS INITIAL.
MODIFY it_final INDEX lv_index TRANSPORTING t1.
ENDIF.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
Building hierarchy table ***************
LOOP AT it_final.
IF it_final-stufe = '0'.
node_tab-type = 'T'.
node_tab-name = 'Project'.
node_tab-tlevel = '01'.
node_tab-nlength = '8'.
node_tab-color = '4'.
node_tab-text = it_final-post1.
node_tab-tlength ='20'.
node_tab-tcolor = 5.
APPEND node_tab.
it_final_hsk-node = node_tab.
APPEND it_final_hsk. CLEAR it_final_hsk.
CLEAR node_tab.
ELSEIF it_final-stufe = '1'.
node_tab-type = 'P'.
node_tab-name = 'Project'.
node_tab-tlevel = '02'.
node_tab-nlength = '10'.
node_tab-color = '1'.
node_tab-kind2 = 'I'.
node_tab-text3+0(4) = it_final-t1.
node_tab-tlength3 = '5'.
node_tab-tcolor3 = 1.
node_tab-kind3 = ' '.
node_tab-text4 = it_final-posid.
node_tab-tlength4 ='20'.
node_tab-tcolor4 = 3.
Code added for plant name
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
EXPORTING
input = it_final-posid
IMPORTING
output = it_final-posid.
READ TABLE it_proj WITH KEY pspid = it_final-posid.
CHECK sy-subrc = 0.
READ TABLE it_t001w WITH KEY werks = it_proj-werks.
CHECK sy-subrc = 0.
Code End.
node_tab-kind4 = ' '.
node_tab-text5 = it_t001w-name1. " Plant Name
node_tab-tlength5 ='25'.
node_tab-tcolor5 = 4.
node_tab-kind5 = ' '.
node_tab-text6 = it_proj-stort.
node_tab-tlength6 ='15'.
node_tab-tcolor6 = 4.
node_tab-kind6 = ' '.
node_tab-text7 = it_final-post1.
node_tab-tlength7 ='25'.
node_tab-tcolor7 = 4.
APPEND node_tab.
it_final_hsk-node = node_tab.
APPEND it_final_hsk. CLEAR it_final.
CLEAR node_tab.
ELSEIF it_final-stufe = '2'.
node_tab-type = 'P'.
node_tab-name = 'Gate Id'.
node_tab-tlevel = '03'.
node_tab-nlength = '10'.
node_tab-color = '1'.
node_tab-kind2 = 'I'.
node_tab-text3+0(4) = it_final-t1.
node_tab-tlength3 = '5'.
node_tab-tcolor3 = 1.
node_tab-kind3 = ' '.
node_tab-text4 = it_final-posid.
node_tab-tlength4 ='20'.
node_tab-tcolor4 = 3.
node_tab-kind4 = ' '.
node_tab-text5 = it_final-post1.
node_tab-tlength5 ='25'.
node_tab-tcolor5 = 4.
APPEND node_tab.
it_final_hsk-node = node_tab.
APPEND it_final_hsk.
CLEAR it_final.
CLEAR node_tab.
ELSEIF it_final-stufe = '3' AND it_final-ltxa1 EQ space.
node_tab-type = 'P'.
node_tab-name = 'Component'.
node_tab-tlevel = '04'.
node_tab-nlength = '11'.
node_tab-color = '1'.
node_tab-kind2 = 'I'.
node_tab-text3+0(4) = it_final-t1.
node_tab-tlength3 = '5'.
node_tab-tcolor3 = 1.
node_tab-kind3 = ' '.
node_tab-text4 = it_final-posid.
node_tab-tlength4 ='25'.
node_tab-tcolor4 = 3.
node_tab-kind4 = ' '.
node_tab-text5 = it_final-post1.
node_tab-tlength5 ='25'.
node_tab-tcolor5 = 4.
Code added for start date and end date for component level.
SELECT SINGLE pstrm petrf INTO (v_pstrm, v_petrf)
FROM prte WHERE posnr = it_final-pspnr.
it_final-fsavd = v_pstrm.
it_final-fssad = v_petrf.
MODIFY it_final INDEX sy-tabix.
WRITE it_final-fsavd TO date_mask MM/DD/YYYY.
node_tab-tpos1 = '0'.
node_tab-kind5 = ' '.
node_tab-text6 = date_mask.
node_tab-tlength6 ='10'.
node_tab-tcolor6 = 3.
CLEAR date_mask.
WRITE it_final-fssad TO date_mask MM/DD/YYYY.
node_tab-tpos1 = '0'.
node_tab-kind6 = ' '.
node_tab-text7 = date_mask.
node_tab-tlength7 ='10'.
node_tab-tcolor7 = 3.
CLEAR date_mask.
APPEND node_tab.
it_final_hsk-node = node_tab.
APPEND it_final_hsk.
CLEAR it_final_hsk.
CLEAR node_tab.
ELSEIF it_final-ltxa1 IS NOT INITIAL.
node_tab-type = 'P'.
node_tab-name = 'Element'.
node_tab-tlevel = '05'.
node_tab-nlength = '11'.
node_tab-color = '1'.
node_tab-kind = 'I'.
node_tab-text1+0(4) = it_final-t1.
node_tab-tlength1 = '5'.
node_tab-tcolor1 = 1.
node_tab-kind2 = 'I'.
node_tab-text3+0(4) = it_final-t2.
node_tab-tlength3 = '5'.
node_tab-tcolor3 = 1.
node_tab-kind3 = ' '.
node_tab-text4 = it_final-ltxa1.
node_tab-tlength4 ='45'.
node_tab-tcolor4 = 3.
node_tab-kind4 = ' '.
node_tab-text5 = it_final-txt04.
node_tab-tlength5 ='10'.
node_tab-tcolor5 = 3.
WRITE it_final-fsavd TO date_mask .
node_tab-kind5 = ' '.
node_tab-text6 = date_mask.
node_tab-tlength6 ='10'.
node_tab-tcolor6 = 3.
CLEAR date_mask.
WRITE it_final-fssad TO date_mask.
node_tab-tpos1 = '0'.
node_tab-kind6 = ' '.
node_tab-text7 = date_mask.
node_tab-tlength7 ='10'.
node_tab-tcolor7 = 3.
CLEAR date_mask.
APPEND node_tab.
it_final_hsk-node = node_tab.
APPEND it_final_hsk.
CLEAR it_final_hsk.
CLEAR node_tab.
ENDIF.
ENDLOOP.
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = it_final_hsk.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = i_repid
callback_user_command = 'USER_COMMAND'
callback_gui_status = 'ZLD_TREE_N'
screen_start_column = 0
use_control = 'L'.
ENDFORM. " hierarchy
*& Form MYGUI
text
-->EX_TAB text
FORM zld_tree_n.
SET PF-STATUS 'ZLD_TREE_N'.
ENDFORM. "zld_tree.
**& Form user_command
Code for REFRESH button
FORM user_command TABLES node STRUCTURE seucomm
USING ucomm CHANGING exit
list_refresh.
CASE ucomm.
WHEN 'REFR' .
CLEAR it_final.
REFRESH it_final_hsk.
REFRESH it_final.
PERFORM getdata.
CLEAR it_final.
PERFORM hierarchy.
WHEN 'BACK1'.
LEAVE TO TRANSACTION 'ZCN41_N'.
ENDCASE.
ENDFORM. "user_command
include.....
*& Include ZDATA_DECLARE
*& Tables used for the report
TABLES: proj, prps, aufk, afvc, jest, tj30t, afvv, prte.
*& Type Pools used
TYPE-POOLS: slis, icon, fibs, stree.
*& Class & Data defination
CLASS DEFINATION
CLASS cl_gui_resources DEFINITION LOAD.
DATA DECLARATION
DATA: g_lights_name TYPE lvc_cifnm VALUE 'LIGHT',
pspid LIKE proj-pspid,
l_pos TYPE i VALUE 1,
gs_layout TYPE slis_layout_alv,
color TYPE zcn41_color_n-color.
DATA : cnt VALUE 'X'.
DATA : i_repid TYPE sy-repid.
DATA : t_node TYPE snodetext.
DATA : node_tab LIKE t_node OCCURS 0 WITH HEADER LINE.
DATA : gv_diff TYPE p, stort LIKE proj-stort.
CONSTANTS: st_formname_top_of_page TYPE slis_formname
VALUE 'TOP_OF_PAGE-ALV'.
*& Internal Table Declarations
DATA it_proj TYPE STANDARD TABLE OF proj WITH HEADER LINE.
DATA it_prps TYPE STANDARD TABLE OF prps WITH HEADER LINE.
DATA it_afvc TYPE STANDARD TABLE OF afvc WITH HEADER LINE.
DATA it_tj30t TYPE STANDARD TABLE OF tj30t WITH HEADER LINE.
DATA it_afvv TYPE STANDARD TABLE OF afvv WITH HEADER LINE.
DATA it_jcds TYPE STANDARD TABLE OF jcds WITH HEADER LINE.
DATA it_t001w TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
DATA: BEGIN OF it_final OCCURS 0,
stufe LIKE prps-stufe,
pspnr LIKE prps-pspnr,
t1 TYPE icon-id,
t2 TYPE icon-id,
node LIKE node_tab,
posid LIKE prps-posid,
post1 LIKE prps-post1,
ltxa1 LIKE afvc-ltxa1,
txt04(20),
objnr LIKE afvc-objnr,
vornr LIKE afvc-vornr,
aufpl LIKE afvc-aufpl,
aplzl LIKE afvc-aplzl,
fsavd LIKE afvv-fsavd, "Ear. Start date
fssad LIKE afvv-fssad, "Ear. finish date
werks LIKE t001w-name1, " added after update
stort LIKE proj-stort, " added after update
END OF it_final.
DATA: BEGIN OF it_hsk OCCURS 0,
t2 TYPE icon-id,
t1 TYPE icon-id,
posid LIKE prps-posid,
post1 LIKE prps-post1,
objnr LIKE afvc-objnr,
stufe LIKE prps-stufe,
END OF it_hsk.
DATA: BEGIN OF it_new OCCURS 0,
objnr LIKE afvc-objnr,
fsavd LIKE afvv-fsavd,
fssad LIKE afvv-fssad,
udate LIKE jcds-udate,
t2(10),
END OF it_new.
CLEAR : node_tab, node_tab[].
DATA : entval TYPE prps-posid.
DATA : ct_fieldcat TYPE slis_t_fieldcat_alv.
DATA : BEGIN OF it_final_hsk OCCURS 0,
node LIKE node_tab,
END OF it_final_hsk.
DATA : project LIKE bapipr-project_definition,
e_project_definition LIKE bapi_project_definition_ex.
DATA : e_wbs_hierarchie_table TYPE STANDARD TABLE OF bapi_wbs_hierarchie
WITH HEADER LINE.
DATA : e_wbs LIKE e_wbs_hierarchie_table OCCURS 0 WITH HEADER LINE.
DATA: v_pstrm LIKE prte-pstrm, v_petrf LIKE prte-petrf,
v_posnr LIKE prps-pspnr.
*& Selection Screen of the report
SELECTION-SCREEN BEGIN OF BLOCK pms WITH FRAME TITLE text-001.
SELECT-OPTIONS so_posid FOR proj-pspid OBLIGATORY.
SELECT-OPTIONS so_plant FOR proj-werks.
SELECT-OPTIONS so_loc FOR proj-stort.
SELECT-OPTIONS so_date FOR sy-datum.
SELECTION-SCREEN END OF BLOCK pms.
*AT SELECTION-SCREEN .
READ TABLE it_proj WITH KEY pspid = so_posid.
IF sy-subrc <> 0.
MESSAGE 'Project Name dose not exist' TYPE 'E.
ENDIF.
include..
*& Include ZSUBR
*& Form date_difference
text
--> p1 text
<-- p2 text
FORM date_difference .
CALL FUNCTION 'ZDATETIME_DIFFERENCE_N'
EXPORTING
date1 = it_final-fsavd
time1 = '000000'
date2 = it_final-fssad
time2 = '000000'
IMPORTING
datediff = gv_diff
EXCEPTIONS
INVALID_DATETIME = 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. " date_difference
*& Form date_monitor
text
--> p1 text
<-- p2 text
T1 for more than 1 days activities
Subroutines result out the T1 on basis of 80% of activity ( Green )
or if 20 % reamined. ( Yellow )
FORM date_monitor .
DATA: date TYPE string,
temp_date TYPE string,
lv_date LIKE afvv-fsavd,
lv_date_final LIKE afvv-fsavd,
lv_days LIKE bseg-dtws1 VALUE 0.
CONSTANTS: con TYPE f VALUE '0.8'.
*lv_date = it_new-fsavd.
IF gv_diff EQ 2.
lv_days = 1.
CALL FUNCTION 'ZCALC_DATE_N'
EXPORTING
date = it_final-fsavd
days = lv_days
months = '00'
sign = '+'
years = '00'
IMPORTING
calc_date = lv_date_final.
IF sy-datum LE lv_date_final.
it_final-t1 = '@08@'.
ELSEIF sy-datum GT lv_date_final AND
sy-datum EQ it_final-fssad.
it_final-t1 = '@09@'.
ENDIF.
ELSEIF gv_diff > 2.
lv_days = con * gv_diff.
CALL FUNCTION 'ZCALC_DATE_N'
EXPORTING
date = lv_date
days = lv_days
months = '00'
sign = '+'
years = '00'
IMPORTING
calc_date = lv_date_final.
IF sy-datum LE lv_date_final.
it_final-t1 = '@08@'.
ELSEIF sy-datum GT lv_date_final AND
sy-datum EQ it_final-fssad.
it_final-t1 = '@09@'.
ENDIF.
ENDIF.
ENDFORM. " date_monitor
this code will give you exact out put as you required from bootom to top functinality....with status.... -
Validation in Project Definition No Range
Dear Expert,
I am creating a validation of project definition number range specific for a project profile but not get sucess.
Scenario is like this..i have a project profile Z000001 for which there is a number range of project code 1000 to 1999
i had created a validation as :-
Prerequisite :- PROJ-PROFL = 'Z000001'
Check :- ( ( PROJ-PSPID :4-7: >= '1813' ) AND ( PROJ-PSPID :4-7: < '2000' ) )
Project Code logic is XX/XXXX , ex PL/1814
But While creating Project Code system is giving the error massage in both right n wrong conditionHi,
PSPID & POSID both dont consider special characters.
PROJ - PSPID = "SN-001".
Here :1-6: means "SN001" for 1-5 & "0" for 6 as characters.
PRPS - POSID = "SN-001-CIV"
Here :1-6: means "SN001" for 1-5 & "C" for 6 as characters.
In Your case just try changing your check statement to.
Check :- ( ( PROJ-PSPID :3-6: >= '1813' ) AND ( PROJ-PSPID :3-6: < '1999' ) )
and update the test result.
Regards,
Pradeep -
Hi!
can you help me for this situation i want to delect line n° 2 because is open
Nom : ZDI_PS_0120_20080903_171907
00000406 BS-BNP__-08-0246-11-JMD test PR00000406 10000001 00000000 00000000 BS-BNP__-08-0246-01 fr 00000000 00000000 I0046 E0001
HERE>>>> 00000425 BS-BNP__-08-0246-0211 Test PR00000425 10000002 00000000 00000000 BS-BNP__-08-0246-02 Test 00000000 00000000 E0001
my programme :
DATA i_xvbpa.
DATA i_yvbadr.
TABLES INTERNE
TYPES: BEGIN OF ty_exportfile,
exporttext(1000) TYPE c,
END OF ty_exportfile.
DATA : BEGIN OF ty_sortie OCCURS 0,
ma(1000) TYPE c,
END OF ty_sortie.
TYPE-POOLS : icon, slis.
*declaration des tables
TABLES: prps, prhi, proj, vbak, tj02t, tj30t, vbap, jest, tvarvc,kna1,vbpa.
*Structure du fichier en sortie
TYPES : BEGIN OF ty_sortie,
pspnr TYPE prps-pspnr,
posid TYPE prps-posid,
post1 TYPE prps-post1,
objnr TYPE prps-objnr,
vernr TYPE prps-vernr,
usr08 TYPE prps-usr08,
usr09 TYPE prps-usr09,
pspid TYPE proj-pspid,
post1_proj TYPE proj-post1,
guebg TYPE vbak-guebg,
gueen TYPE vbak-gueen,
kunnr TYPE vbpa-kunnr,
name1 TYPE kna1-name1,
istat TYPE tj02-istat,
estat TYPE tj30-estat,
END OF ty_sortie.
*Structure des tables prps
TYPES : BEGIN OF ty_prps,
pspnr TYPE prps-pspnr,
posid TYPE prps-posid,
post1 TYPE prps-post1,
objnr TYPE prps-objnr,
vernr TYPE prps-vernr,
usr08 TYPE prps-usr08,
usr09 TYPE prps-usr09,
pspid TYPE proj-pspid,
post1_proj TYPE proj-post1,
END OF ty_prps.
TYPES : BEGIN OF ty_vbak,
pspnr TYPE vbap-ps_psp_pnr,
vbeln TYPE vbak-vbeln,
guebg TYPE vbak-guebg,
gueen TYPE vbak-gueen,
kunnr TYPE vbak-kunnr,
END OF ty_vbak.
TYPES : BEGIN OF ty_vbpa,
kunnr TYPE vbpa-kunnr ,
END OF ty_vbpa.
TYPES: BEGIN OF it_vbak_line,
vbeln LIKE vbak-vbeln,
vkorg LIKE vbak-vkorg,
vtweg LIKE vbak-vtweg,
spart LIKE vbak-spart,
kunnr LIKE vbak-kunnr,
END OF it_vbak_line.
END OF ty_vbpa.
TYPES : BEGIN OF ty_kna1,
name1 TYPE kna1-name1 ,
END OF ty_kna1.
TYPES : BEGIN OF ty_jest,
objnr TYPE jest-objnr,
stat TYPE jest-stat,
END OF ty_jest.
DATA t_sadrvb TYPE TABLE OF sadrvb WITH HEADER LINE.
DATA t_vbpavb TYPE TABLE OF vbpavb WITH HEADER LINE.
DATA t_prps TYPE TABLE OF ty_prps.
DATA w_prps LIKE LINE OF t_prps.
DATA w_sortie TYPE ty_sortie.
DATA ty_exportfile TYPE table of ty_exportfile.
DATA w_exportfile TYPE ty_exportfile.
*table et structure pour exportation des parametres vers la fonction
DATA t_vbpa TYPE TABLE OF ty_vbpa .
DATA w_vbpa TYPE TABLE OF ty_vbpa .
DATA t_vbak TYPE TABLE OF ty_vbak.
DATA w_vbak LIKE LINE OF t_vbak.
DATA r_stat TYPE RANGE OF tj30-estat.
DATA w_stat LIKE LINE OF r_stat.
*DATA w_exportfile TYPE ty_exportfile.
TYPES : BEGIN OF ty_tj30t,
estat TYPE tj30t-estat,
txt04 TYPE tj30t-txt04,
END OF ty_tj30t.
DATA t_tj30t TYPE TABLE OF tj30t.
DATA w_tj30t LIKE LINE OF t_tj30t.
DATA t_tj02t TYPE TABLE OF tj02t.
DATA w_tj02t LIKE LINE OF t_tj02t.
DATA t_jest TYPE TABLE OF ty_jest.
DATA w_jest LIKE LINE OF t_jest.
DATA t_zpar_ps_0120 TYPE TABLE OF zpar_ps_0120.
DATA w_zpar_ps_0120 LIKE LINE OF t_zpar_ps_0120.
CONSTANTS k_filename TYPE filename-fileintern VALUE 'ZDI_PS_0120'.
DATA w_filename TYPE string.
DATA w_nb_enr TYPE i.
initialiser la table zpar_ps_0120
INITIALIZATION.
SELECT * INTO TABLE t_zpar_ps_0120 FROM zpar_ps_0120.
IF sy-subrc NE 0.
MESSAGE e398(00) WITH 'Table ZPAR_PS_0120 non gérée'(a01).
ENDIF.
ALIMENTER LA TABLE zpar_ps_0120
PERFORM fill_zpar_ps_0120.
Libellés TJ02T TJ30T chargés en T_TJ02T T_TJ30T
PERFORM get_description.
Récupérer la dernière date de traitement
SELECT SINGLE * FROM tvarvc WHERE name = 'ZDI_PS_0120_DER_EXE'.
Renvoie un nom de fichier physique à partir d'un nom de fichier logique
PERFORM get_file.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
START-OF-SELECTION.
REFRESH t_prps.
REFRESH t_vbak.
REFRESH t_vbpa.
*sélectionner les champs pspnr posid post1
PERFORM select_projects.
*ouvrir un fichier texte afin que celui-ci soit lu
OPEN DATASET w_filename FOR OUTPUT
IN TEXT MODE ENCODING UTF-8.
SORT t_vbak BY pspnr.
SORT t_jest BY objnr stat.
SORT t_tj02t.
SORT t_tj30t.
CLEAR w_nb_enr.
utiliser une boucle pour la table prps
PERFORM fill_w_filename.
CLOSE DATASET w_filename.
Si fin normale, mettre à jour la date dans variable
UPDATE tvarvc
SET low = sy-datum
WHERE name = 'ZDI_PS_0120_DER_EXE'.
COMMIT WORK.
*écriture de fichier
WRITE : / 'Fichier',
w_filename,
'écrit'.
*écriture de nbre d' enregistrement
WRITE : / 'Nb enregistrements : ',
w_nb_enr.
*******************************ROUTINES******************************
*& Form GET_FILE
text
--> p1 text
<-- p2 text
FORM get_file .
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = k_filename
IMPORTING
file_name = w_filename
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
ENDFORM. " GET_FILE
*& Form SELECT_PROJECTS
text
--> p1 text
<-- p2 text
FORM select_projects .
SELECT prpspspnr prpsposid prps~post1
prpsobjnr prpsvernr prpsusr08 prpsusr08 projpspid projpost1
INTO TABLE t_prps
FROM prps
INNER JOIN prhi
ON prhiposnr = prpspspnr
INNER JOIN proj
ON projpspnr = prhipsphi
WHERE prps~stufe IN ('2', '3')
AND prps~belkz = 'X'
AND ( prps~erdat GE tvarvc-low
OR prps~aedat GE tvarvc-low ).
IF NOT t_prps[] IS INITIAL.
SELECT vbapps_psp_pnr vbakvbeln vbakguebg vbakgueen vbak~kunnr
INTO TABLE t_vbak
FROM vbap
INNER JOIN vbak
ON vbakvbeln = vbapvbeln
FOR ALL entries IN t_prps
WHERE vbap~ps_psp_pnr = t_prps-pspnr.
SELECT objnr stat
INTO TABLE t_jest
FROM jest
FOR ALL ENTRIES IN t_prps
WHERE objnr = t_prps-objnr
AND inact NE 'X'
AND stat IN r_stat.
ENDIF.
ENDFORM. " SELECT_PROJECTS
*& Form FILL_W_FILENAME
text
--> p1 text
<-- p2 text
FORM fill_w_filename .
LOOP AT t_prps INTO w_prps.
CLEAR w_sortie.
MOVE-CORRESPONDING w_prps TO w_sortie .
READ TABLE t_vbak INTO w_vbak WITH KEY pspnr = w_prps-pspnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING w_vbak TO w_sortie.
CALL FUNCTION 'SD_PARTNER_READ'
EXPORTING
f_vbeln = w_vbak-vbeln
object = 'VBPA'
no_master_adress = 'X'
TABLES
i_xvbadr = t_sadrvb
i_xvbpa = t_vbpavb
I_YVBADR =
I_YVBPA =
I_XVBPA2 =
I_YVBPA2 =
READ TABLE t_vbpavb WITH KEY parvw = 'WE'.
IF sy-subrc = 0.
w_sortie-kunnr = t_vbpavb-kunnr.
w_sortie-name1 = t_vbpavb-name1.
ELSE.
READ TABLE t_vbpavb WITH KEY parvw = 'AG'.
w_sortie-kunnr = t_vbpavb-kunnr.
w_sortie-name1 = t_vbpavb-name1.
ENDIF.
ENDIF.
*alimenter t_jest
LOOP AT t_jest INTO w_jest WHERE objnr = w_prps-objnr.
IF w_jest-stat(1) = 'E'.
lecture de t_tj30t
READ TABLE t_tj30t INTO w_tj30t WITH KEY estat = w_jest-stat
BINARY SEARCH.
IF sy-subrc = 0.
w_sortie-estat = w_jest-stat.
w_sortie-estat = w_tj30t-txt04.
ELSE .
w_sortie-estat = w_tj30t-txt04.
w_sortie-estat = w_jest-stat.
ENDIF.
ELSEIF w_jest-stat(1) = 'I'.
lecture de t_tj02t
READ TABLE t_tj02t INTO w_tj02t WITH KEY istat = w_jest-stat
BINARY SEARCH.
IF sy-subrc = 0.
w_sortie-istat = w_jest-stat.
w_sortie-istat = w_tj02t-txt04.
ELSE.
w_sortie-istat = w_tj02t-txt04.
*w_sortie-istat = w_jest-stat.
ENDIF.
ENDIF.
ENDLOOP.
*Fill table exportfile with separators
LOOP AT w_sortie.
CONCATENATE
w_sortie-pspnr
'| ' w_sortie-posid
'| ' w_sortie-post1
'| ' w_sortie-objnr
'| ' w_sortie-vernr
'| ' w_sortie-usr08
'| ' w_sortie-usr09
'| ' w_sortie-pspid
'| ' w_sortie-post1_proj
'| ' w_sortie-guebg
'| ' w_sortie-gueen
'| ' w_sortie-kunnr
'| ' w_sortie-name1
'| ' w_sortie-istat
'| ' w_sortie-estat into w_exportfile-exporttext.
APPEND w_exportfile.
ENDLOOP.
TRANSFER w_exportfile TO w_filename .
ADD 1 TO w_nb_enr.
TRANSFER w_sortie TO w_filename .
ADD 1 TO w_nb_enr.
ENDLOOP.
ENDFORM. " FILL_W_FILENAME
*& Form FILL_ZPAR_PS_0120
text
--> p1 text
<-- p2 text
FORM fill_zpar_ps_0120 .
LOOP AT t_zpar_ps_0120 INTO w_zpar_ps_0120.
w_stat-sign = 'I'.
w_stat-option = 'EQ'.
IF NOT w_zpar_ps_0120-statut_systeme IS INITIAL.
w_stat-low = w_zpar_ps_0120-statut_systeme.
APPEND w_stat TO r_stat.
ENDIF.
IF NOT w_zpar_ps_0120-statut_utilisat IS INITIAL.
w_stat-low = w_zpar_ps_0120-statut_utilisat.
APPEND w_stat TO r_stat.
ENDIF.
ENDLOOP.
ENDFORM. " FILL_ZPAR_PS_0120
*& Form GET_DESCRIPTION
text
--> p1 text
<-- p2 text
FORM get_description .
SELECT *
INTO TABLE t_tj02t
FROM tj02t
FOR ALL ENTRIES IN t_zpar_ps_0120
WHERE istat = t_zpar_ps_0120-statut_systeme
AND spras = sy-langu.
SELECT *
INTO TABLE t_tj30t
FROM tj30t
FOR ALL ENTRIES IN t_zpar_ps_0120
WHERE stsma = t_zpar_ps_0120-stsma
AND estat = t_zpar_ps_0120-statut_utilisat
AND spras = sy-langu.
ENDFORM. " GET_DESCRIPTION
THANKS.Hi Mustafa,
try this:
SELECT e~pbukr p~pspid e~posid e~pgsbr p~post1
e~objnr e~ernam e~erdat e~post1
INTO TABLE psp
FROM ( prps AS e INNER JOIN proj AS p
ON e~psphi = p~pspnr
JOIN jest AS j
ON e~objnr = j~objnr )
WHERE e~pbukr IN bukrs
AND e~pgsbr IN gsber
and J~stat in stati.
´
greetings
Andreas -
Transaction for obtain monthly Profits and Loses by entering profit center
Does anybody know a transaction to obtain a monthly report where I can analyse the financial results entering a profit center???
Hello,
Try following....
Use BAdi BUS2054.
In that write an implementation
Two scenarios
1) Creating new project. (Values in PRPS table will get updated after save.)
2) Opening existing project in change mode. ( Already values corresponding to that WBSE are available in PRPS table).
Pre-Requisite:
1) If possible make Profit center field madatory.
Scenario 1:
In Implementation write
At_save
IF PRPS-PRCTR = initial or zero. Then no error. Because he is creating Project, so no values will be available in PRPS. Once he saves PRPS will get updated and from next it will be delt as per scenario 2 below.
Scenario 2:
At_save
If PRPS-PRCTR <> the value entered by the user (i.e. user trying to enter something different which is already there in PRPS table against that WBSE (PRPS-POSID)) throw an error "Profit center can not be changed".
Please try along with ur abaper.
Post ur findings.
Thanks & Regards
Saikishore.Ganga -
Hello Gurus:
I have had to use BOTH 'null' and 'space' (ofcourse I tried 'initial' too...) when selecting data from PRPS table, otherwise all the required records were not fetched. I had to do this on two different occassions. The first is a SAP provided field and the other is customer's enhancement. I have cut-paste the two code blocks. Any ideas why?
Thanks in advance,
Sard.
***********(1)**************
select posid objnr func_area zzfunct from prps into
corresponding fields of table it_wbs
where func_area is null or
func_area eq space.
************(2)**************
select prps-pspnr prps-posid prps-post1
into (wa_test1-pspnr, wa_test1-posid, wa_test1-post1,
from prps
where prps-posid in s_wbs and
... and
( prps-zzmlind is null or prps-zzmlind eq space ).
append wa_test1 to it_test1.
clear wa_test1.
endselect.Hello Richard,
the Requirement to check for NULL corresponds to the definition of the database (field) within the DDIC. Check the flag initialize (it has also some documentation).
This flag is intended to be used if the definition of the db table is changed at SAP while the table already is used at customer side.
After deploying the corresponding patch or upgrade such a changed definition may result into the need to convert all entries. For tables with many entries this would result into inacceptable downtime. So such changes are done without the initialiazation/conversion of existing entries.
The tradeoff is the syntax you noticed.
Kind regards
Klaus -
How to populate values in listbox of a field?
HI all,
My requirement is : i have one filed , for that i have five values,
i want to display those five values in the list box. then i have to select one of them and based on this field i have to display few fields in table control .
here i am able to display the values in listbox but even i select any value , it showing the first vale only !!!!!!
please help me in this regard.This is the way........
DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
DATA : L_PSPNR TYPE PROJ-PSPID,
L_WBSE TYPE PRPS-POSID.
PARAMETERS : P_BPO TYPE CKIS-EXTNR
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BPO.
DATA : BEGIN OF IT_BPO OCCURS 100,
BPO LIKE ZCKIS-BPO,
END OF IT_BPO.
DYNFIELDS-FIELDNAME = 'P_PSPNR'.
APPEND DYNFIELDS.
CLEAR DYNFIELDS.
DYNFIELDS-FIELDNAME = 'P_WBSE'.
APPEND DYNFIELDS.
CLEAR DYNFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
Rewards if satisfied
Thanks -
Values r not fetch in internal table
Hi Frds
In my report the values are not fetching in the internal table ICOSP
This is my program ,kindly correct my mistake.
DATA : WBS LIKE VBAK-PS_PSP_PNR.
SELECTION-SCREEN: BEGIN OF BLOCK 01.
SELECTION-SCREEN: BEGIN OF BLOCK 02 WITH FRAME .
SELECT-OPTIONS PROJECT FOR WBS.
SELECTION-SCREEN: END OF BLOCK 02.
SELECTION-SCREEN: END OF BLOCK 01.
DATA: BEGIN OF IVBAK OCCURS 0,
VBTYP LIKE VBAK-VBTYP, "SD document category
AUART LIKE VBAK-AUART, "Sales Document Type
NETWR LIKE VBAP-NETWR, "NET VALUE OF THE ORDER ITEM
WAERK LIKE VBAK-WAERK, "SD document currency
PS_PSP_PNR LIKE VBAP-PS_PSP_PNR, "WBS Element
END OF IVBAK.
DATA: BEGIN OF IPRPS OCCURS 0,
PSPNR LIKE PRPS-PSPNR, "WBS Element
POSID LIKE PRPS-POSID, "WBS Element
OBJNR LIKE PRPS-OBJNR, "Object number
PSPHI LIKE PRPS-PSPHI, "Current project number
END OF IPRPS.
DATA: BEGIN OF ICOSP OCCURS 0,
OBJNR LIKE COSP-OBJNR,
GJAHR LIKE COSP-GJAHR,
WRTTP LIKE COSP-WRTTP,
BEKNZ LIKE COSP-BEKNZ,
WTG001 LIKE COSP-WTG001,
WTG002 LIKE COSP-WTG002,
WTG003 LIKE COSP-WTG003,
WTG004 LIKE COSP-WTG004,
WTG005 LIKE COSP-WTG005,
WTG006 LIKE COSP-WTG006,
WTG007 LIKE COSP-WTG007,
WTG008 LIKE COSP-WTG008,
WTG009 LIKE COSP-WTG009,
WTG010 LIKE COSP-WTG010,
WTG011 LIKE COSP-WTG011,
WTG012 LIKE COSP-WTG012,
WTG013 LIKE COSP-WTG013,
WTG014 LIKE COSP-WTG014,
WTG015 LIKE COSP-WTG015,
WTG016 LIKE COSP-WTG016,
SUM TYPE CURRENCY ,
END OF ICOSP.
*DATA: ICOSP LIKE COSP OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF ITAB OCCURS 0,
PSPNR LIKE VBAK-PS_PSP_PNR,
NETWR LIKE VBAP-NETWR,
END OF ITAB.
PERFORM IVBAK.
PERFORM IPRPS.
PERFORM ICOSP.
PERFORM MOVE_COSP.
PERFORM MOVE.
PERFORM FIELDCATALOG.
PERFORM BUILD_LAYOUT.
PERFORM ALVDISPLAY.
FORM IVBAK.
SELECT VBTYP AUART NETWR WAERK PS_PSP_PNR FROM VBAK INTO TABLE IVBAK
WHERE PS_PSP_PNR IN PROJECT AND
VBTYP = 'G' AND AUART = 'ZPCQ'.
CLEAR: IVBAK.
ENDFORM. "IVBAK
FORM IPRPS.
SELECT PSPNR POSID OBJNR PSPHI FROM PRPS INTO TABLE
IPRPS WHERE PRPS~PSPHI IN PROJECT.
CLEAR : IPRPS.
ENDFORM. "IVBAP
FORM ICOSP.
LOOP AT IPRPS.
SELECT OBJNR GJAHR WRTTP BEKNZ WTG001 WTG002 WTG003 WTG004 WTG005
WTG006 WTG007 WTG008 WTG009 WTG010 WTG011
WTG012 WTG013 WTG014 WTG015 WTG016
FROM COSP INTO CORRESPONDING FIELDS OF TABLE ICOSP
WHERE OBJNR = IPRPS-OBJNR AND WRTTP = '4'.
ENDLOOP.
CLEAR:ICOSP.
ENDFORM.
Thanks
Parihi,
try this Code
DATA : wbs LIKE vbak-ps_psp_pnr.
SELECTION-SCREEN: BEGIN OF BLOCK 01.
SELECTION-SCREEN: BEGIN OF BLOCK 02 WITH FRAME .
SELECT-OPTIONS project FOR wbs.
SELECTION-SCREEN: END OF BLOCK 02.
SELECTION-SCREEN: END OF BLOCK 01.
TYPES: BEGIN OF ivbak,
vbtyp LIKE vbak-vbtyp, "SD document category
auart LIKE vbak-auart, "Sales Document Type
netwr LIKE vbap-netwr, "NET VALUE OF THE ORDER ITEM
waerk LIKE vbak-waerk, "SD document currency
ps_psp_pnr LIKE vbap-ps_psp_pnr, "WBS Element
END OF ivbak.
TYPES: BEGIN OF iprps,
pspnr LIKE prps-pspnr, "WBS Element
posid LIKE prps-posid, "WBS Element
objnr LIKE prps-objnr, "Object number
psphi LIKE prps-psphi, "Current project number
END OF iprps.
TYPES: BEGIN OF icosp,
objnr LIKE cosp-objnr,
gjahr LIKE cosp-gjahr,
wrttp LIKE cosp-wrttp,
beknz LIKE cosp-beknz,
wtg001 LIKE cosp-wtg001,
wtg002 LIKE cosp-wtg002,
wtg003 LIKE cosp-wtg003,
wtg004 LIKE cosp-wtg004,
wtg005 LIKE cosp-wtg005,
wtg006 LIKE cosp-wtg006,
wtg007 LIKE cosp-wtg007,
wtg008 LIKE cosp-wtg008,
wtg009 LIKE cosp-wtg009,
wtg010 LIKE cosp-wtg010,
wtg011 LIKE cosp-wtg011,
wtg012 LIKE cosp-wtg012,
wtg013 LIKE cosp-wtg013,
wtg014 LIKE cosp-wtg014,
wtg015 LIKE cosp-wtg015,
wtg016 LIKE cosp-wtg016,
sum TYPE currency ,
END OF icosp.
*DATA: ICOSP LIKE COSP OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF itab,
pspnr LIKE vbak-ps_psp_pnr,
netwr LIKE vbap-netwr,
END OF itab.
DATA : i_ivbak TYPE STANDARD TABLE OF ivbak,
i_prps TYPE STANDARD TABLE OF iprps,
i_icosp TYPE STANDARD TABLE OF icosp,
wa_ivbak TYPE ivbak,
wa_prps TYPE prps,
wa_icosp TYPE icosp.
PERFORM ivbak.
PERFORM iprps.
PERFORM icosp.
*PERFORM MOVE_COSP.
*PERFORM MOVE.
*PERFORM FIELDCATALOG.
*PERFORM BUILD_LAYOUT.
*PERFORM ALVDISPLAY.
FORM ivbak.
SELECT vbtyp auart netwr waerk ps_psp_pnr FROM vbak
INTO TABLE i_ivbak
WHERE ps_psp_pnr IN project AND
vbtyp = 'G' AND auart = 'ZPCQ'.
ENDFORM. "IVBAK
*& Form IPRPS
* text
FORM iprps.
SELECT pspnr posid objnr psphi
FROM prps INTO TABLE
i_prps WHERE prps~psphi IN project.
ENDFORM. "IVBAP
*& Form ICOSP
* text
FORM icosp.
IF i_prps[] IS NOT INITIAL.
SELECT objnr gjahr wrttp beknz wtg001 wtg002 wtg003 wtg004 wtg005
wtg006 wtg007 wtg008 wtg009 wtg010 wtg011
wtg012 wtg013 wtg014 wtg015 wtg016
FROM cosp INTO CORRESPONDING FIELDS OF TABLE i_icosp
FOR ALL ENTRIES IN i_prps
WHERE objnr = i_prps-objnr AND wrttp = '4'.
ENDIF.
ENDFORM. "ICOSP
Regards
Sandipan
Maybe you are looking for
-
How to add norwegian language to my ipa-file in Adobe Flash Professional and Settings for AIR
Hi, How to add Norwegian languages to my ipa-file in Adobe Flash Professional and Settings for AIR? The Norwegian users get my apps in english instead of Norweigan. Desperate for help! Regards Ylva
-
Hi We have crated an New Internal order and entered the budgeted / planned figures using the KPF6, When we check the report s_alr_87013017, s alr87013018 and s_alr_87012993 does not show committed. We need a report showing committed spend, actual sp
-
How to see contents imported GPO ?
At this time ZCM-server: SLES10_x64 with ZCM10.3.1 and Standalone server WIN2003server with AD (This server only for creation GPO. To it nobody logs in ) In it the server has been created GPO. From the console of this server WIn2003 has launched IE7
-
Google Maps on Iphone Question
Hey everyone, got a question here. I heard that Google Maps can send traffic reports, as in when I start a route it could tell me which roads are jammed and offer alternative routes. Is this true? If so how do I do it and is it available to do on a U
-
How to quote while replying in this forum?
Hi, i have some general question, while replying to the questions i haven't seen the quote option and wondering how you are quoting other replies. i have read the FAQs in this forum none of them specified how quote? Can some explain me how to quote?