Parent child relationship for h:selectOneMenu
I am trying to create a h:selectOneMenu child list when the parent list is selected I want to use that selection as the value to build my child list with.
But when I use the valueChangeListener it does not fire.
So I am wondering if there is another way to build the child list based on the selection.
I am using jDeveloper 10.1.3.4.0.4270, and i am only using JSF HTML components.
Thanks
Tyler
Re: JSF selectOneMenu valueChangeListener not firing
Similar Messages
-
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.... -
Find parent/child relationships At More Than 2 Levels
Hello,
Does anyone have a solution to find parent/child relationship for data more than 2 levels deep?
I have a solution when there's a simple parent-child relationship but not when there's a grandparent-parent-child relationship or deeper.
Ex. I have a table company_parent_child that stores the relationship betwen a company and it's direct parent.
create table TEMP_COMPANY_PARENT_CHILD
PARENT_ID NUMBER(10),
COMPANY_ID NUMBER(10)
insert into TEMP_COMPANY_PARENT_CHILD values (1, 10);
insert into TEMP_COMPANY_PARENT_CHILD values (1, 11);
insert into TEMP_COMPANY_PARENT_CHILD values (1, 12);
insert into TEMP_COMPANY_PARENT_CHILD values (2, 13);
insert into TEMP_COMPANY_PARENT_CHILD values (10, 100);
insert into TEMP_COMPANY_PARENT_CHILD values (10, 101);
insert into TEMP_COMPANY_PARENT_CHILD values (10, 102);
insert into TEMP_COMPANY_PARENT_CHILD values (11, 103);
1->
___10->
______100,101,102,
___11->103
Companies 100, 101 and 102 are under parent 10 and grandparent 1.
I need to create such a view or another temp table so that when I pass the parent ID, I will pull all the children on all levels. In addition, and this is the tricky part, when I join this new temp table or view to another data table without any parameters, the data should not be duplicate, ie. each company ID should appear only once.
create table TEMP_JOIN
company_id number(10),
order_id varchar2(10)
insert into TEMP_JOIN values (100, 'a');
insert into TEMP_JOIN values (101, 'b');
insert into TEMP_JOIN values (102, 'c');
insert into TEMP_JOIN values (103, 'd');
insert into TEMP_JOIN values (10, 'e');
insert into TEMP_JOIN values (11, 'f');
insert into TEMP_JOIN values (12, 'e');
insert into TEMP_JOIN values (13, 'f');
Thanks.start by learning CONNECT BY/START WITH. once you've
written a query to read the grandparent-parent-child
relationship, then come back with more questionsYes. we did look heavily into connect by/start with, in fact along with "connect_by_iscycle","connect_by_isleaf","connect_by_root" as well.
Our dilemma is that when a joint is made between those two tables mentioned above TEMP_COMPANY_PARENT_CHILD and TEMP_JOIN, we are not able to create a view that would contain distinct company_ids, each mapped to a unique order id.
The problem is we cannot have this type of joint when there are "n" level relationship between companies (or company_id). Basically, I think we should have our unique order id mapped to a unique key. This unique key should be a specialized key that we can know at anytime the entire path of the ancestry which we can know by sys_connect_by_path(company_id,'/') path.
How do we know which path to take. The best bet is to "connect_by_isleaf" and just have the distinct "deep" path which form the specialized unique key. If you need help on this let me know. (A hint, sort by LEVEL and then do a rank after partitioning by company id and then filter the records by rank = 1, try this one!!!)
So, we will eventually have a joint (say Table X) like
PATH ORDER_ID
/1/10/100 a
/1/10/101 b
/1/10/102 c
/1/10 e
/1
/1/11/103 d
/1/11 f
I think this is the best view we can have to maintain a joint with no repetition along PATH as well as ORDER_ID. If you have any other thoughts, let me know.
Then you query by path using INSTR to pull records by company_id.
for example, if you want to get all the children for company_id "10" you would just say
select * from X where INSTR(PATH,10,1,1) <> 0
or if you want to get all the children for company_id "11" you would just say
select * from X where INSTR(PATH,11,1,1) <> 0
What do you think? Has anyone used the path information for traversing the tree? Or is there any article that tells us how to make effective use of sys_connect_by_path(company_id,'/') path.
Thank you. Hope it made sense! -
Customer Master -- Parent + Child Relationship
Hi
I have an requirement from user asking me to set Parent -Child relationship for a customer.
Correct me if i am wrong.
I have customer numbers 1000 and 2000.
In "payment transactions" tab , i have included 2000 in "Alternat. Payer" field. So now 2000 will be the alternative payer for 1000 customer.
I want to see this relationship in FBL5N. In what way should i ensure that the functionality is maintained.
Please let me know
Thanks
Rajanikanth.Please note I do not respond direct through e mail, only on this forum.
If the customer has not been set up correctly there will not be any entries in the branch field.
As mentioned you need to have the parent customer number set as the "payer " partner function in the child's customer account number.
This will mean you are selling to the chil, but the parent is paying, and this is where the invoice will go to.
If you have not set the master data up like this, then there will not be any values there for you.
Please award points if this is helpful and has been helpful so far. -
Parent child relationship is not displaying for IDOC_OUTPUT_ORDERS (PO)
Hi,
Can somebody help me the reason why parent child relationship not displaying properly for ORDER05 basic type?
If we go in details about the problem, a purchase order is creating in R/3 through EBP. To modify my requirement I am using userexit EXIT_SAPLEINM_002. Here I am appending the records in the segment for E1EDKT1 and E1EDKT2. IDOC is creating with an error of status record 26.
When I check in the transaction WE19 for the respective IDOC the data is showing correctly for all the segments including e1edkt1 and e1edkt2 segments and also I check in the table EDID4 segment number is showing correctly and the for the segment E1EDKT2 PGNUM also showing correctly, but when I see the IDOC in the transactions WE02 unable to see parent child relationship between E1EDKT1 and E1EDKT2 segment. Simply the data is displaying one below other like other segment.
I don't know the reason why it is displaying like that?
If anybody is having the solution is highly appreciable.
Regards,
Noorulhi hassan,
When you are appendng the REcods which belong to the purticular segment..
all the segment needs to be appended in in the proper order as in the WE30..
I<b> think you are appending the segment E1EDKT2 at the end of the EDIDD.. or IDOC_DATA in the user exit..</b> .. eventho no eerror will be displayed but idoc will generted with sataus 26 .. if check the <b>STATUIs Recored u ewill find the SYNTaX ERROR.</b>
<b>Sollution for ur probelm is</b>... don append the E1EDKT2 at the lastr instead <b>you ahve to insert the segment E1EDKT2. only afer E1EDKT1..</b>..
Tehn you r problem will be solved.. I had faced the Same proble when i worked on material maser idoc..
<b>Close this thread if when u r problem ise solved</b>
Reward if helpful
Regards
Naresh Reddy K -
Material exchange in a PO for a parent child relationship
Hi ,
Please advise if there are SAP provide any solution for material exchange in a PO for a parent child relationship? I.e the two materials are NOT maintained as interchangable materials.
Thanks.
Regards,
Claricehello
Do you mean exchange agreements/contracts where two parties are buyer & seller both to each other. This is well supported by Std SAP.
Pls correct me, if I am not getting it correct.
Ganesh... -
How to use GL Parent Child relationships in Discoverer?
Subject: How to used GL Parent Child relationships in Discoverer?
How to use GL Parent Child relationships in Discoverer?
Please let me know how to incorporate the parent -child relation ships exsiting in GL Accouting flexfield Segments in Discoverer for drill downs? we have GL - BIS views installed.
How to create the specific Parent -child relationship hierarchies in Discoverer from the FND_* tables?
Please help.
Thanks.
KS.Hi,
I'm also trying to implement this. If you have come any further in solving this any hints would be much appreciated...
regards,
AJ -
Parent-Child Relationships in Essbase Studio
In Essbase Studio, I am defining a hierarchy in which a parent member (Wholesaler) is from one dimension table and child member (Rep) is from another. When I preview this hierarchy or build an outline to include it, a few of the Reps that should rollup to a certain Wholesaler are missing. They are not dropped, but Essbase Studio just never recognizes these Reps as being children of that Wholesaler in the first place. However, if I run a sql query against the source data mart with the correct joins, these missing reps do show up in the records of that Wholesaler. Also, the missing Reps are showing up fine in the hierarchy preview as long as I don't make them children of anything in the Wholesaler dim. So Essbase Studio is able to see these Reps, but just can't figure out how they are related to the given Wholesaler. Again, this is only happening for about 10% of the Reps for the Wholesaler. Other Reps are showing up fine in the parent-child relationship.
In the source data mart, I don't see any NULLs or anything amiss in the records for the missing Reps. What other reasons would Essbase Studio not recognize a particular joined record?it really does sound like a join issue. You say if you just load the children without the parent, they load, but if you associte them to the parent, they don't. You might try when creating the joins to do a full outter join to see if they load and to what.
One other thing you could try would be to create a user defined table that has the join in it. I've found data atype issues in joins from different tables before. Studio is very pickey about this
Edited by: GlennS_3 on Oct 20, 2010 9:12 AM -
How to output the outline parent-child relationship using a report script?
I'd like to extract the outline's dimension members with it's parent-child relationship using a report script. Anybody can provide a sample script? Thanks.
Example:
DimensionX
-----MemberX
----------ChildX
Output:
Dimension X MemberX
MemberX ChildX
Edited by: obelisk on Jan 11, 2010 5:16 PMSorry a report script won't do it. You have two options
1. Use at Essbase Outline API to walk the outline and get it for you
2. Use the Outline extractor available from Applied Olap (it is a free download). It can be run interactively of as a bat file.
Frankly, I would rather use 2 since I don't have to code it myself -
Implement Parent child Relationship using SSIS
Could you please suggest the best way which should not impact the performance of data loading, to implement parent child relationship using SSIS.
We have a flat file RECON80.dat which need to be loaded into the database into 2 tables.
Parent Table JobMaster and Child Table RECON80 .
In the flat file we have a fields Jobphase which will get inserted in JobMaster table and the remaning details like EIN, DATE etc will get inserted in RECON80 table.
The Parent table JobMaster has JobId as an identity column which is the Pk of the table and it will get inserted into the child table i.e RECON80 JobId as FK of the child tale.
Please suggest the best possible way to achieve it.Hi SubhadipRoy, I think you might need to create a procedure for this task.
Because in SSIS, we cannot directly get the Identity ID.
As my experience, there were serveral ways to do. But all are workaround.
So, My suggestion is.
In SSIS:
1. Create a DataFlow
2. Drag a flat source and load the data from dat file
3. Create a procedure which receive the parameter from your data of each row.
4. Drag a OLEDBCommand to the Panel and Invoke the Procedure also don't forget to pass all your rows to the Procedure in OLEDBCommand control.
5. In Procedure, after insert 1 row you could get the Identity ID throuth SCOPE_IDENTITY()
That's it, hope it works for you even this may not the efficency way.
Althrough, I expect someone can give the best way if there is. -
Parent-Child Relationship between app
Hi,
I am trying to deploy 2 applications, which needs to have a parent-child relationship between them.
One option is i should driectly change server.xml, and put parent tag in this Xml file and restart the container.
Another option is i can use my Ant Target to invoke command line argument which uses admin.jar and which has parent attribute... so when i give the command to put parent-child relationship, the container gives the message that app2 has parent app1 but actually it doesnt put the required tag in server.xml and nor does it put the relationship in place.
So any workaround for this... how can i put that relationship in place without modifying server.xml.
We are running 9ias 9.0.2.3 on True64
Thanks in advanceHi,
Has anyone done sumthing like this before... even after trying everything i am still not able to do parent- child relationship between applications.
Thanks & Regards -
Parent Child Relationships between Drop Down Menus
I have a request for additional functionality. Parent child relationships between drop down lists.
for example,
the first dropdown, could contain North, South, East, West & assign values of 1, 2, 3, 4.
the second dropdown, could contain a filtered set of data depending on the option from the first dropdown,
so the data could look like this in the second drop down:
Manchester 1
Leeds 1
London 2
Southampton 2
Norfolk 3
Newquay 4
so if I select North in the first dropdown, the second drop down would contain all the items with a value of 1, so Manchester & Leeds.
I have managed to get round this using conditional show & hide, but it is much messier on the design screen & also the way in which the data
will be returned is very very messy - seems like a simple addition which would improve the functionality no end.Hi,
We have an "ideas" page where you can see if others have added this already, I believe there are some similar, and you can add your vote. If you don't find something that fits you can add your idea here:
http://forums.adobe.com/community/formscentral?view=idea
Thanks,
Josh -
How to model parent child relationship with DPL? @Transient?
Hello All,
I want to model a parent entity object with a collection of child entities:
@Entity
public class Parent{
@PrimaryKey
String uuid;
List<Child> children;
@Entity
public class Child{
@PrimaryKey
String id;
I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
Thanks in advance,
Steven
Harvard Children's Hospital Informatics Program
Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PMHi Steven,
The definition of persistence is here:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
I suggest looking at this javadoc:
http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
--mark -
How to create Parent Child relationship of Assets
Hi All
can any one provide the solution for the below mention requirment.
Problem Description: How to create Parent Child relationship of Assets in below case.
1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
3. If asset Category of Child assets are same for new assets.Hi All
can any one provide the solution for the below mention requirment.
Problem Description: How to create Parent Child relationship of Assets in below case.
1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
3. If asset Category of Child assets are same for new assets. -
Question about File Content Conversion and parent-child relationships...
Hello!
I have read probably every blog, article and SAP Help document on the topic, but I am stuck on this one. I am trying to convert a General Ledger flat file to an IDoc using the classic file --> IDoc scenario. The setup is done and working, but the IDocs are formatted incorrectly and I believe at least part of the reason is how I am converting the file content.
The root of my problem is that the flat file has a parent-child relationship between the document header and the document item and I want to maintain that since the IDoc type (FIDCCP01) has the same structure in the BKPF and BSEG segments.
Here is the flat (non-XML) file layout that is coming into the file adapter:
FileHeader
DocumentHeader
DocumentItem
DocumentHeader
DocumentItem
and so on (until the number of documents is complete
I would really like the content to be converted so that the line items stay under their parent document headers like this:
<FileHeader></FileHeader>
<DocumentHeader>
<ItemHeader>
</ItemHeader>
</DocumentHeader>
<DocumentHeader>
<ItemHeader>
</ItemHeader>
</DocumentHeader>
But I keep getting this, where it lists the document headers first (one after another), and then all of the line items after the document headers like this:
<FileHeader></FileHeader>
<DocumentHeader></DocumentHeader>
<DocumentHeader></DocumentHeader>
<DocumentHeader></DocumentHeader>
<ItemHeader></ItemHeader>
Is is possible to maintain that parent-child relationship from the flat file and pass it over to the XML?
Thanks,
JohnHi,
Check some links on FCC.
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward points if Helpful
Maybe you are looking for
-
Issue Printing One or Two Checks on HP LaserJet Pro 200 MFP M276nw
I just purchased an HP LaserJet Pro 200 MFP M276nw which replaces an HP Color LaserJet 2605dn. I've run into an issue printing checkes from Quicken when I print less than a full sheet (one or two) checks. With my old printer, I used the manual feed f
-
Technical interview questions on this objects
Hi every one i am putting some objects in my resume can any one tell me the all possible questions on these objects. my id is [email protected] Reports: Developed a Report to display the values of Total Finished Goods filtered by Plant.
-
Webservice security: manipulating the SOAP Header
Hi all, I need to call a web service for which the following XWSS security policy is specified: <xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config"> <xwss:RequireUsernameToken passwordDigestRequired="t
-
Invoice List accounting and factorial Discount/Taxes
Hi , Is it possible to Post Invoice list ( Doc Type LR )Document to FI . If Yes then pl. tell me the procedure ? How can we use factorial Discount and Factorial Tax in Invoice list . if these two conditions are used the how to post in Customers accou
-
I can't open certain internet pdf's?
I can't open certain internet pdf's?