Javascript: parent.framename.document.forms[i].elements.length
I have a PHP-Script 1 with an iframe.
In this iframe an other PHP-Script 2 is loaded, which contains several forms.
In one of this forms I make a call by button with onclick="..." to a javascript-function.
The javascript-function is contained in an external file *.js. Declaration in PHP-Script 2: <Script type="text/javascript" src="WartArtikel-Probe.js"></Script>.
Inside the javascript-function I use:
Scenario 1:
var i = 0;
var anzelem = parent.framename.document.forms[i].elements.length;
or:
var anzelem = parent.frames[0].document.forms[i].elements.length;
or:
var anzelem = window.document.forms[i].elements.length;
When I press the button, the javascript-function gives no answer.
But when I start PHP-Script 2 directly (not inside an iframe) and the javascript-function is written as:
Scenario 2:
var i = 0;
var anzelem = document.forms[i].elements.length;
this example works!
How can I get an answer in scenario 1?
Additional suggestion: Is it possible to switch the browser into a development-modus, where javascript-syntax-errors are displayed? This could be very helpful!
To view script errors, you can keep the Browser Console open in a separate window. To open that, you can use either:
* Ctrl+Shift+j
* "3-bar" menu button > Developer > Browser Console
* Tools menu > Web Developer > Browser Console
My guess is you will find some kind of security related issue.
Similar Messages
-
Javascript - document.forms[0].elements
Hi,
I'm trying ...
var els = document.forms[0].elements;
for(var i=0; i < els.length ; i++) {
var compVal = els[i].alt;
Its working in IE but not in Safar. Any alternative. Please help?http://www.w3schools.com/TAGS/att_input_alt.asp says 'alt' is not supported in Safari.
Any other function to access alt attribute in Javascript. If not, How can I do in jQuery.. -
Document.form.element.value
Hi All,
I'm very new to javascript and had a quick question! Her is a sample of my code.
<script language="JavaScript" type="text/javascript">
function fnShowText(txt)
var x = document.getElementById(txt);
var e = document.getElementById(txt).name;
var sText = x.options.value;
var f = e.concat("b");
for (i=0; i<mainform.elements.length; i++)
if (mainform.elements<i>.name == f)
document.forms[0].elements<i>.value = sText;
</script>
I know what the value of elements is, but I want this script to be dynamic. Instead of looping through all the elements to find the value 'i' like I am currently doing it. This is bad response time. Is there a way to skip the looping and make this call dynamically if I already have the name of the element?
Thanks in advance!
Eric
By the way there is a 'i' after elements but for some reason it isn't showing up on this board.if you have a input tag in your html page you can go about it the following ways.
<input type=text name="t1" id="t1"></input>
<script>
document.getElementById("t1").value = "here";
document.getELementsByName("t1")[0].value = "there";
</script>
getElementsByName brings back an array.
getElementByID gets back one object.
You should test your taget browsers with both of these. I know that IE works fine with getID, but others do not. -
document.forms[0].action=AWURL;
document.forms[0].elements["WWWACTION"].value='APPLY';
//12-1TEDHRQ - identify the action as legitimate, to avoid the warning popup
legitimateAction = true;
//12-1TEDHRQ - eof
document.forms[0].onsubmit();
formatHTML();
/* GIT remmed-out*/ //document.cookie = "AWIZ_PREVIEW_MODE=ON; domain=oraclecorp.com; path=/";
/* GIT Version */
document.cookie = "AWIZ_PREVIEW_MODE=ON; domain=oracle.com; path=/";
/* eof GIT Version */
// alert ('Cookie Set ' + readCookie('AWIZ_PREVIEW_MODE'));
document.forms[0].submit();
}Your PHP script is not secured at all. I would recommend using Forms To Go (http://www.bebosoft.com/products/formstogo/overview) to create the PHP script.
The unregistered version can be used for free. It will get you up and running in no time.
In your HTML form,remove enctype="multipart/form-data" from this:
<form action="contactformprocess_original_db.php" method="post" enctype="multipart/form-data" name="form1" id="form1" target="ifr">
enctype="multipart/form-data" is only required if you have a file upload field in the form. -
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.... -
How can I attach a PDF in an email, using javascript in PDF document?
How can I attach a PDF in an email, using an interactive button in the PDF-document?
I tried to create a form button with the menu action 'attach this PDF in an email'.
This Send.to-action doesn't work with Microsoft.
Does anyone has a solution by implementing a javascript-code for this in the PDF?Dick,
Thanks for your replie.
Nice alternative, but it still doesn't work on a Windows machine when the
mail software from Microsoft doesn't react on PDF actions.
You can do many things in Acrobat, but it is a problem when it doesn't work
on Windows and iPad.
So now I am looking for alternatives like interactive magazine software
(based on html5).
2012/5/11 dick the flash <[email protected]>
Re: How can I attach a PDF in an email, using javascript in PDF
document?
created by dick the flash <http://forums.adobe.com/people/dicktheflash>in
JavaScript - View the full discussion<http://forums.adobe.com/message/4395927#4395927 -
Problem with document.form.submit()
Hi
I have a URL like "http://blrkec30386:9080/abcd/MyServlet?Action.Admin.Init=Y&AppSignonBankId=024"
when i write this in a plane html file (as given below) ina form and submitt the same it works fine.. but if i include the same to a jsp (environment WSAD5) it does not work. and it tries to open the url "http://blrkec30386:9080/abcd/MyServlet?" that means if it finds a question mark(?) it stops there....ane idea why this is behaving like this???
given below is my code for plane html file.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Home Page</title>
</head>
<script language="JavaScript">
function submitForm()
document.form10.action=""http://blrkec30386:9080/ececWeb/BANKAWAY?Action.Admin.Init=Y&AppSignonBankId=024";
document.form10.submit();
</script>
<body onload="return submitForm()">
<form name="form10" id="form10" ACTION="http://blrkec30386:9080/abcd/MyServlet?Action.Admin.Init=Y&AppSignonBankId=024" method="POST">
</form>
</body>
</html>When you use the POST method for form submission, you should not have any parameters in the URL, the parameters are supposed to be in the body of the HTML request (one of the big differences between POST and GET requests). Your server may truncate the URL because they aren't supposed to be there, or it might move them to the body where they belong (do they show up in the processing servlet?). Some servers just pretend that they are okay and process them normally...
Adding parameters to a POSTing form like that should be avoided, though. What you should do is make hidden input fields with the values you want. (note, this ensures that the request is formatted correctly, but you will see no parameters on the url, which is the way it is supposed to be...)
<html>
<head>
<title>Home Page</title>
<script language="JavaScript">
function submitForm()
document.form10["Action.Admin.Init"].value="N";
document.form10["AppSignonBankId"].value="025";
document.form10.submit();
</script>
</head>
<body onload="return submitForm()">
<form name="form10" id="form10" action="http://blrkec30386:9080/abcd/MyServlet" method="POST">
<input type="hidden" name="Action.Admin.Init" value="Y"/>
<input type="hidden" name="AppSignonBankId" value="024"/>
</form>
</body>
</html> -
B2B EDI translation ----Is it possible to increase the sub-element length
B2B EDI translation ----Is it possible to increase the sub-element length??
Am new to the B2B 10g- EDI Integration environment. In our production setup, am getting the following error.
B2B EDI Translation failed, because one of the fields was too long. The length of Sub-element length is '41'. The maximum allowed length is '35'.
In the segment RFF defined in the guideline at position 0070; Is it possible to increase / expand the lenght from 35 to 41.....
Thanks and Rgds,
-SriniHi Nitesh
I have the same problem what srini explained above.
I'm using Oracle B2B Document editor.
That corresponding element's field is in disabled state ,a red triangle displays in top right corner of that field.
Could you help me to solve this issue?
Regards
Kathir -
Opener.document.forms.wwv_flow.supplier has no properties
I'm trying to pass a value from a Popup page to a multi-row report (tabular form).
and I'm getting the error, which you can read in my subject line of this posting.
I don't know what the error is telling me when it reads: SUPPLIER has no properties.
the javascript is as follows:
opener.document.forms["wwv_flow"].supplier['f01_0008'].value = passVal1; close()...
where SUPPLIER is the item in the Tabular Form to receive the value I'm passing back from the popup page.
and
f01_0008 is the identifier for the row in the tabular form to passback to.
Can anyone help me here?Hi Carl. Thanks for your reply. I'm really floundering around here with this.
I don't really know how to write javascript, but am using what I find available and trying to adapt it to my application.
I found an example in the forum that seemed to be an exact match to what I was trying to do, but it was incomplete.
This is the code that I've got in the HTML header of my Popup page:
<script language="JavaScript">
function passBack(passItem1, passVal1)
opener.document.forms["wwv_flow"].supplier['&P143_ITEM.'].value = passVal1; close();
</script>
P143_ITEM is a hidden item on the popup page that contains the rownumber from the tabular form on the calling page.
SUPPLIER is a column in the row of the calling page.
And is where I want to pass the value To from the popup page.
When I drag my cursor over the hyperlink text on the Popup page,
Then the information I see at the bottom of the page is this:
javascript:passBack('f01_0006','Graybar Electric Co.');
It appears to be correct.
Where F01_0006 is the row where I want to pass the value GRAYBAR ELECTRIC CO.
The problem seems to be that I cannot specify the Column where I want to pass
'Graybar Electric Co.' to. (ie: the column SUPPLIER)
If you have any ideas, it would be greatly! appreciated.
Thanks- Gary -
Hi,
I'm on LiveCycle ES 8.2. For PDF submit forms from workspace, I assigned the servername for submit as URL:
http://adobe1234:8080/workspace-server/submit.
We are using Document Form variable for this process. The reason is the forms will be digitally signed at each stage and we dont want to loose their signatures if forms go next stage.
This works perfect when I submit the form.
Now, we will be moving all the existing instances to new server and I want this URL to be server independent.
I take off this URL and kept it blank and try to submit from workspace. Nothing happens if I click submit and the form stays at the same place.
I see the following error in the log file:
2012-03-29 15:07:17,541 ERROR [org.jgroups.protocols.UDP] failed unmarshalling message
java.io.EOFException
at java.io.DataInputStream.readShort(Unknown Source)
at org.jgroups.Message.readFrom(Message.java:630)
at org.jgroups.protocols.TP.bufferToMessage(TP.java:973)
at org.jgroups.protocols.TP.handleIncomingPacket(TP.java:829)
at org.jgroups.protocols.TP.access$400(TP.java:45)
at org.jgroups.protocols.TP$IncomingPacketHandler.run(TP.java:1296)
at java.lang.Thread.run(Unknown Source)
I have to avoid using this URL in the form as I will be moving my system to new domain & DNS and for any existing process instances, if they try to submit the form, that will error out as the URL is pointing to another server.
Your help is highly appreciated.
Thanks,
kcI don't think I read your first post thoroughly. I see now you are setting the URL to prevent the form from appearing altered. I don't use digital signatures, but can see the potential problem. My first thought was to put JavaScript in the form to set the URL, but that would likely cause the same problem. I probably can't be of much help with no experience using the digital signatures. Our forms are considered 'Signed' if a logged in user clicks approve. Have you deleted the Form Bridge and readded? There may be differences with the one in ES2.
I think you are also saying you can't set the URL server side before rendering the form because processes will launch under one domain then get changed later.
If you were able to use JavaScript to determine which URL to submit to, you could put that code in the Form Bridge code and I would think that would submit. The form is not being altered by the code. This is assuming the code snippet I copied out of the form bridge is really what is called.
/** Invoke the standard Submit action */
function submitAction(doc, url, type) {
if ( BRIDGE_SUBMIT_URL != null ) url = BRIDGE_SUBMIT_URL;
if ( BRIDGE_SUBMIT_TYPE != null ) type = BRIDGE_SUBMIT_TYPE;
if ( type == null ) type = "PDF";
if (url != null) {
setFocus(null); // force current field focus out in 8.1 + readers (null op in previous versions)
// doc.submitForm({cURL: url, bEmpty: true, cSubmitAs: type, cCharset: "utf-8"});
doc.submitForm({cURL: url, cSubmitAs: type}); -
Issues in creating Interactive Form UI element at runtime.
Hi Experts,
I have a requirement according to which i need to create multiple PDF forms at runtime.This i need to do using webdynpro Java.
The approach that i would be using is creating interactive form U I element at runtime.
So in a test application in views wdDoModifyView i added the below code i.e.
In the do modify view i have added the below piece of code
if (!firstTime)
IWDNodeInfo l_sel_nodeInfo =
wdContext.nodeCtx_vn_binary().getNodeInfo();
IWDAttributeInfo l_attrInfo =
l_sel_nodeInfo.getAttribute(
IPrivateAdobeView1.ICtx_vn_binaryElement.CTX__VA__BINARY);
if (view.getElement("adobeFrm") == null) {
IWDTransparentContainer container =
(IWDTransparentContainer) view.getElement(
"RootUIElementContainer");
IWDInteractiveForm adobeFrm =
(IWDInteractiveForm) view.createElement(
IWDInteractiveForm.class,
"adobeFrm");
adobeFrm.bindDataSource(
wdContext.nodeCtx_vn_adobe().getNodeInfo());
adobeFrm.setMode(WDInteractiveFormMode.UPDATE_DATA_IN_PDF);
adobeFrm.setTemplateSource("AdobeView1_InteractiveForm.xdp");
adobeFrm.setDisplayType(WDInteractiveFormDisplayType.NATIVE);
adobeFrm.bindPdfSource(l_attrInfo);
adobeFrm.setVisible(WDVisibility.VISIBLE);
container.addChild(adobeFrm);
adobeFrm.setTemplateSource("AdobeView1_InteractiveForm.xdp");
But now i am stuck at this point as its giving me null pointer exception on execution.
Could some one provide me links to the tutorials which contains dynamic creation of Interactive form UI element.
I do have links which show creation of input fields at run time but couldn't get any on creation of Interactive Form UI element at runtime (dynamically).
Thanks in advance!!!Hello Dan,
About the license issue, take a look at the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/interactiveforms">Adobe Interactive forms section on SDN</a> on the right side there is a FAQ. In the FAQ there is something mentioned about license.
When you are using NWDS04s the Adobe Document Service (ADS) is already installed. You only need to configure the ADS. Take a look at <a href="http://service.sap.com/adobe">http://service.sap.com/adobe</a> on the left click on "Media Library" --> "Documentation".
When you want to make use of Adobe Interactive forms you need a Adobe Reader 7.x.x or higher.
Hope it helps.
Kind regards,
Maarten. -
Hi,
We are using Interactive form UI element in Webdynpro ABAP.
Actually the requirement is to create SAP office documnet i.e . save this form as PDf file on desktop and then load this file in SAP as SOFM object.
Reason is that we want to use this SOFM object in workflow .
Problem is that we are not able to use FM SO_OBJECT_UPLOAD as while using this FM in web-dypro we are getting error as Front end services not available.
Do we have similar Function module / utility class which we can use for uploading the file in SAP system as Office document?
Regards,
AkshayHello Dan,
About the license issue, take a look at the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/interactiveforms">Adobe Interactive forms section on SDN</a> on the right side there is a FAQ. In the FAQ there is something mentioned about license.
When you are using NWDS04s the Adobe Document Service (ADS) is already installed. You only need to configure the ADS. Take a look at <a href="http://service.sap.com/adobe">http://service.sap.com/adobe</a> on the left click on "Media Library" --> "Documentation".
When you want to make use of Adobe Interactive forms you need a Adobe Reader 7.x.x or higher.
Hope it helps.
Kind regards,
Maarten. -
Problem with using javascript in interactive adobe form
Hi All,
I have a problem when accessing text field value which is present inside a subform using javascript.
I tried giving data.page4.sub-5.<fieldname>.rawvalue but its not working. Please provide a solution.
Thank you in Advance.Since this question is related to JavaScript running within the Form and not the connection between the form and Web Dynpro - it really belongs in the Interactive Forms by Adobe Forum.
-
When I try to start Firefox I get an Error Message: (Javascript /application) Error on adding toolbar element. TypeError, aButtonLabel is undefined. id. Google Shortcut settings. Firefox will not start. I have been through the troubleshooting steps. Nothing helps
== I tried to enter Firefox. No apparant reason ==
== User Agent ==
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; AskTbGLSV5/5.8.0.12304)Hi,
had this problem but now sorted.
Go to settings for google shortcuts, follow link to homepage and upload latest version, it has not yet been approved by Firefox, but works and solves the bug.
Hope this helps.
A -
Document name exceeds allowed length
Hello all,
We are getting an "Document name exceeds allowed length" error when we want to approve a shopping card. There is no attachments in the SC and no reason for this error. First of all we already created the SC and approval WF started and now when we check the document this error occurs.
Do you have any idea where to start checking?
Best regardsHi
The error should not be raised in the case where no attachment exists, it is raised normally when the attachment URL exceeds 255 characters.
However - perhaps you need to apply the note [1269204|https://service.sap.com/sap/support/notes/1269204]. This may be the issue in your system.
Regards,
Jason
Edited by: Jason Boggans on Apr 19, 2010 10:15 AM
Maybe you are looking for
-
How do I connect my NI USB-6259 properly to SCXI?
I have a NI USB-6259 DAQ Module a SCXI-1001 Chassis 3 SCXI-1143 8 Channel Low Pass Filter Modules and a SCXI-1180 Front End Plate I use a SH68-68-EPM Cable for Connecting the USB-6259(Connector 0) to a SCXI-1349. Is it wise to use another Cable to co
-
Posting Cash Payments and Clearing Invoices
Hi everybody, Can anybody suggest a transaction to post payments (money) and clear FI invoices. I am looking for a transaction where the user can pull an invoice by doing a search by invoice number, or by PO number, and to post a payment against the
-
Wrong date format when import CSV files
When you import a CSV file that contains fields with German date formats, these fields are displayed incorrectly. Example: Contents of the CSV file "01.01.14". After importing the corresponding cell in Numbers has the content "40178". A reformat the
-
Sound changes when moving mp3 from quicktime to itunes
When I move a mp3 from quicktime to itunes the sound changes. itunes makes it sound a little worse from the original mix. I dont think its the equalizer becuase i tried fooling around with that and tuning it off for a better result. So the mp3 sounds
-
Using Lightroom Mobile as travel downloader/editor
Friends, I'm a new member of the Lightroom family. I'd like to use Lightroom Mobile while traveling whereby I download RAWs (or RAWs and .jpegs) to my iPad, edit the images on my iPad, then easily sync/transfer those edits to my computer when I get