First occurence of a value from a field in the internal table.
How to select the first occurence of a value from a field in an internal table ?
I don think , we can use select query .
Any suggestions?
provide syntaxs also .
Hi...
You have to use this code.
DATA : Begin of IT_MARA occurs 0,
mtart type mara-mtart,
matnr type mara-matnr,
meins type mara-meins,
END OF IT_MARA.
START-of-SELECTION.
SELECT MTART MATNR MEINS FROM MARA INTO TABLE IT_MARA.
END-OF-SELECTION.
LOOP AT IT_MARA.
<b> AT NEW MTART. "This will trigger for every first/new value of the field
<<<<WRITE YOUR CODE here>>
ENDAT.</b>
ENDLOOP.
You can also use.
LOOP AT IT_MARA.
<b> <b> ON CHANGE OF IT_MARA-TART.
<<<<WRITE YOUR CODE here>>
ENDON.</b></b>
ENDLOOP.
<b>Reward if Helpful.</b>
Similar Messages
-
Reading from select-options field into the internal table
Hi,
I have to read the low and high ranges from the select-options fields into a field in the internal table in order to update the same field in line item table. since the user may change the screen fields, i need to pass the values directly from the screen and store it in a variable in the internal table. Is there a way to pass both ranges, low and high to one variable which holds the entire range?
Thanks,
SruthyHi,
In the Selection screen you can directly read the field(Select-option)value using read statement as follows:
READ TABLE <SELECT-OPTIONS field name> [using index] INTO <work area>.
After reading you can directly access all the values as follows and can store them in the variables:
var1 = <work area>-LOW
var2 = <work area>-HIGH
var3 = <work area>-SIGN
var4 = <work area>-OPTION
as per your requirement.
I think this will help you.
<b>Kindly reward if helpful.</b>
Regards,
Shakuntala. -
To populate values into single field in an internal table
Hi Friends,
How we need to populate values into single field in an internal table.
E.g itab consits of single field ( name)
i need to assign values to this field name .like
peter,
john,
abrahm,
daneyal
Pls tell me i how i need to code for this
Thanks ,
ParnithHi,
Please look at the below code :
DATA : BEGIN OF itab OCCURS 0 ,
name(20) TYPE c,
END OF itab.
START-OF-SELECTION.
itab-name = 'Peter'.
APPEND itab.
CLEAR itab.
itab-name = 'John'.
APPEND itab.
CLEAR itab.
itab-name = 'Abrahm'.
APPEND itab.
CLEAR itab.
itab-name = 'Daneyal'.
APPEND itab.
CLEAR itab.
LOOP AT itab.
WRITE : / itab.
ENDLOOP.
Thanks,
Sriram Ponna. -
Coloring a field in the internal table
Hi all,
How can I color a field in the internal table knowing that I'm developing a classic report.
Thanks in advance.hi,,,
check this code.
*-----TABLES DECLARATION
tables : kna1, "Customer Master
vbak, "Sales Document Header
vbap, "Sales Document Item
sscrfields. "Screen Field Table
& D A T A D E C L A R A T I O N &
data : begin of it_kna1 occurs 0,
kunnr type kna1-kunnr, "Customer Number
land1 type kna1-land1, "Country Key
name1 type kna1-name1, "Name
ort01 type kna1-ort01, "City
end of it_kna1.
data : begin of it_kna2 occurs 0,
kunnr type kna1-kunnr, "Customer Number
land1 type kna1-land1, "Country Key
name1 type kna1-name1, "Name
ort01 type kna1-ort01, "City
end of it_kna2.
data: begin of it_vbak occurs 0,
vbeln type vbak-vbeln, "Sales Document
erdat type vbak-erdat, "Date
ernam type vbak-ernam, "Name of Person
auart type vbak-auart, "Sales Document Type
end of it_vbak.
data: begin of it_vbap occurs 0,
vbeln type vbap-vbeln, "Sales Document
posnr type vbap-posnr, "Sales Document Item
matnr type vbap-matnr, "Material Number
matkl type vbap-matkl, "Material group
end of it_vbap.
data: v_count type int4, "Current Row Index
v_line like sy-lisel, "Contents of selected line
v_kunnr like kna1-kunnr.
& S E L E C T I O N S C R E E N &
selection-screen begin of block b1 with frame title text-001.
selection-screen begin of line.
parameters : rb1 radiobutton group g1 default 'X'.
selection-screen comment 5(20) text-002 for field rb1.
selection-screen end of line.
select-options : so_kunnr for kna1-kunnr obligatory.
parameters : p_hits(3) type c.
selection-screen begin of line.
parameters : rb2 radiobutton group g1.
selection-screen comment 5(20) text-003 for field rb2.
selection-screen end of line.
parameters : p_file like rlgrap-filename default 'c:\test'.
selection-screen pushbutton /33(10) custl user-command push1.
selection-screen pushbutton 58(10) custd user-command push2.
selection-screen end of block b1.
& I N I T I A L I Z A T I O N &
initialization.
move 'LOAD' to custl.
move 'DISP' to custd.
& A T L I N E S E L E C T I O N &
at selection-screen.
perform validate_kunnr.
& A T S E L E C T I O N S C R E E N O N V A L U E-R E Q U E S T &
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
importing
file_name = p_file.
& S T A R T O F S E L E C T I O N &
start-of-selection.
perform cust_details.
& S T A R T O F S E L E C T I O N &
top-of-page.
format color 3 intensified off.
write :/02(25) sy-repid.
write : 39(15) 'Page'(010), sy-pagno.
format color off.
format color 6 intensified off.
format color col_heading.
uline at :/1(60).
write: /1 sy-vline,
2 'Cust Number'(000),
14 sy-vline,
16 'Country'(007),
25 sy-vline,
26 'City'(008),
42 sy-vline,
43 'Region'(009),
60 sy-vline.
uline at :/1(60).
format color col_heading off.
& T O P O F P A G E D U R I N G L I N E S E L E C T I O N &
top-of-page during line-selection.
if sy-lsind eq 1 or sy-ucomm eq 'VBAK'.
format color col_heading.
uline at :/1(60).
write : /1 sy-vline,
2 'Docu No.'(011),
14 sy-vline,
16 'Date'(012),
26 sy-vline,
27 'Name'(013),
42 sy-vline,
43 'DType'(014),
60 sy-vline.
uline at :/1(60).
elseif sy-lsind eq 2 or sy-ucomm eq 'VBAK'.
set pf-status space.
uline at :/1(60).
write : /1 sy-vline,
2 'Docu No.'(015),
14 sy-vline,
16 'Sales Item'(016),
25 sy-vline,
26 'Mat No'(017),
42 sy-vline,
43 vbap-matkl,
50 'Mat Grp'(018),
60 sy-vline.
uline at :/1(60).
endif.
& AT USER-COMMAND &
at user-command.
case sy-ucomm.
when 'VBAK'.
perform sales_item.
when 'DELIVERY'.
clear it_vbak-vbeln.
get cursor value it_vbak-vbeln.
set parameter id 'AUN' field it_vbak-vbeln.
call transaction 'VA03' and skip first screen.
when 'DISP'.
perform display_basic.
endcase.
& AT LINE SELECTION &
at line-selection.
if sy-lsind = 1.
set pf-status 'DDDD'.
perform sales_header.
elseif sy-lsind = 2.
case sy-ucomm.
when 'PICK'.
set pf-status space.
perform sales_item.
when 'DELIVERY'.
clear it_vbak-vbeln.
get cursor value it_vbak-vbeln.
set parameter id 'AUN' field it_vbak-vbeln.
call transaction 'VA03' and skip first screen.
when 'DISP'.
perform display_basic.
endcase.
PERFORM sales_item.
endif.
& AT USER-COMMAND &
at user-command.
case sy-ucomm.
when 'VBAK'.
perform sales_item.
when 'DELIVERY'.
clear it_vbak-vbeln.
get cursor value it_vbak-vbeln.
set parameter id 'AUN' field it_vbak-vbeln.
call transaction 'VA03' and skip first screen.
when 'DISP'.
perform display_basic.
endcase.
& Form CUST_DETAILS &
form cust_details .
select kunnr
land1
name1
ort01
from kna1
into table it_kna1
where kunnr in so_kunnr.
if sy-subrc <> 0.
message 'SELECT VALID CUST NO' type 'I'.
else.
loop at it_kna1.
v_count = v_count + 1.
if sy-tabix < p_hits.
IF v_count <= p_hits.
move it_kna1 to it_kna2.
append it_kna2.
else.
exit.
endif.
endloop.
endif.
if not it_kna2[] is initial.
loop at it_kna2.
write : /1 sy-vline,
2 it_kna2-kunnr,
14 sy-vline,
16 it_kna2-land1,
25 sy-vline,
26 it_kna2-name1,
42 sy-vline,
43 it_kna2-ort01,
60 sy-vline.
uline at :/1(60).
endloop.
endif.
endform. " CUST_DETAILS
**& Form load_file
*form load_file .
*endform. " load_file
**& Form disp_file
*form disp_file .
*endform. " disp_file
*& Form VALIDATE_KUNNR
form validate_kunnr .
select single kunnr
from kna1
into kna1
where kunnr = so_kunnr.
endform. " VALIDATE_KUNNR
*& Form SALES_HEADER
form sales_header .
data : v_kna1(13).
v_kna1 = 'IT_KNA2-KUNNR'.
*get cursor line sy-lilli value v_line
clear v_kunnr.
get cursor field v_kna1 value v_kunnr.
v_kunnr = v_line+1(10).
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = v_kunnr
importing
output = v_kunnr.
select vbeln
erdat
ernam
auart
from vbak
into table it_vbak
where kunnr = v_kunnr.
if sy-subrc = 0.
loop at it_vbak.
write : /1 sy-vline,
2 it_vbak-vbeln,
14 sy-vline,
16 it_vbak-erdat,
26 sy-vline,
27 it_vbak-ernam,
42 sy-vline,
43 it_vbak-auart,
60 sy-vline.
uline at :/1(60).
endloop.
endif.
endform. " SALES_HEADER
*& Form SALES_ITEM
form sales_item .
data : v_vbeln(13).
v_vbeln = 'IT_VBAK-VBELN'.
clear it_vbak-vbeln.
get cursor field v_vbeln value it_vbak-vbeln.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = it_vbak-vbeln
importing
output = it_vbak-vbeln.
select vbeln
posnr
matnr
matkl
from vbap
into table it_vbap
where vbeln = it_vbak-vbeln.
loop at it_vbap .
write : /1 sy-vline,
2 it_vbap-vbeln,
14 sy-vline,
16 it_vbap-posnr,
25 sy-vline,
26 it_vbap-matnr,
42 sy-vline,
43 it_vbap-matkl,
60 sy-vline.
uline at :/1(60).
endloop.
endform. " SALES_ITEM
*& Form DISP_DOCU
form display_basic .
loop at it_kna1 into it_kna1.
format hotspot on.
write : /03 it_kna1-kunnr,
24 it_kna1-name1.
hide it_kna1-kunnr.
endloop.
endform. " display_basic
pls reward if useful
regards,
rekha -
Mapping corresponding field in the internal table
Hi guys I need help with putting XML value into the appropriate fields in the internal table struc. I attempted to use if else condition to map the element name (cname)over to the fields but those internal table within an internal table post an issue of when to append and so on ... I am using FM SMUM_XML_PARSE and the output in to this table type smum_xmltb (containing all the XML Element and Values) I want to map it to its corresponding field in the internal table (defined below)
Pls pardon this newbie here as this is very new to me. Hope to hear fr u all soon and points will be given! ")
XML->>
<?xml version="1.0" encoding="iso-8859-1"?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<BOOKLIST>
<DATE>2006-09-25</DATE>
<TIME>16:27:20</TIME>
<BOOK_RECORD>
<BOOK_NUM>0012345678</BOOK_NUM>
<SHORT_DESC>OMS BOOK</SHORT_DESC>
<BOOK_GROUP>
<BOOK_CATEGORY>
<CATEGORY_ID>03</CATEGORY_ID>
<CATEGORY_DESC>BOOK group 3</CATEGORY_DESC>
</BOOK_CATEGORY>
<BOOK_CATEGORY>
<CATEGORY_ID>02</CATEGORY_ID>
<CATEGORY_DESC>BOOK group 2</CATEGORY_DESC>
</BOOK_CATEGORY>
</BOOK_GROUP>
</BOOK_RECORD>
<BOOK_RECORD>
<BOOK_NUM>0012345679</BOOK_NUM>
<SHORT_DESC>SAP BOOK</SHORT_DESC>
<BOOK_GROUP>
<BOOK_CATEGORY>
<CATEGORY_ID>01</CATEGORY_ID>
<CATEGORY_DESC>BOOK group 1</CATEGORY_DESC>
</BOOK_CATEGORY>
<BOOK_CATEGORY>
<CATEGORY_ID>09</CATEGORY_ID>
<CATEGORY_DESC>BOOK group 9</CATEGORY_DESC>
</BOOK_CATEGORY>
</BOOK_GROUP>
</BOOK_RECORD>
</BOOKLIST>
</asx:values>
</asx:abap>
INTERNAL TABLE ->>
TYPES: BEGIN OF ADD_CATEGORY,
CATEGORY_ID(10),
CATEGORY_DESC(40),
END OF ADD_CATEGORY,
ADD_T_CATEGORY TYPE ADD_CATEGORY OCCURS 0.
TYPES: BEGIN OF ADD_BOOK_GRP,
BOOK_CATEGORY TYPE ADD_T_CATEGORY,
END OF ADD_BOOK_GRP,
ADD_T_BOOK_GRP TYPE ADD_BOOK_GRP OCCURS 0.
TYPES: BEGIN OF ADD_BOOK,
BOOK_NUM(10) TYPE C,
SHORT_DESC(40) TYPE C,
BOOK_GROUP TYPE ADD_T_BOOK_GRP,
END OF ADD_BOOK,
ADD_T_BOOK TYPE ADD_BOOK OCCURS 0.
TYPES: BEGIN OF TYPE_DATA,
DATE TYPE SY-DATUM,
TIME TYPE SY-TIMLO,
BOOK_RECORD TYPE ADD_T_BOOK,
END OF TYPE_DATA.
DATA: I_DATA TYPE TYPE_DATA OCCURS 0 WITH HEADER LINE.hi,
here is the code sample using ixml library .
just create a report program and copy paste the following code.
REPORT y_test_xml.
DATA: l_ixml TYPE REF TO if_ixml,
l_ixml_sf TYPE REF TO if_ixml_stream_factory,
l_istream TYPE REF TO if_ixml_istream,
l_ostream TYPE REF TO if_ixml_ostream,
l_booklist TYPE REF TO if_ixml_element,
l_document TYPE REF TO if_ixml_document,
l_parser TYPE REF TO if_ixml_parser,
l_root_element TYPE REF TO if_ixml_element,
l_book_record TYPE REF TO if_ixml_element,
l_date TYPE REF TO if_ixml_element ,
l_time TYPE REF TO if_ixml_element ,
l_book_group TYPE REF TO if_ixml_element,
l_book_cat TYPE REF TO if_ixml_element ,
others TYPE REF TO if_ixml_element ,
link TYPE REF TO if_ixml_element ,
description TYPE REF TO if_ixml_element ,
xml TYPE xstring ,
size TYPE i ,
l_xml TYPE REF TO cl_xml_document .
DATA: xml_out TYPE string ,
temp_string TYPE string .
TYPES: BEGIN OF add_category,
category_id(10),
category_desc(40),
END OF add_category,
add_t_category TYPE add_category OCCURS 0 .
TYPES: BEGIN OF add_book_grp,
book_category TYPE add_t_category,
END OF add_book_grp,
add_t_book_grp TYPE add_book_grp OCCURS 0.
TYPES: BEGIN OF add_book,
book_num(10) TYPE c,
short_desc(40) TYPE c,
book_group TYPE add_t_book_grp,
END OF add_book,
add_t_book TYPE add_book OCCURS 0.
TYPES: BEGIN OF type_data,
date TYPE sy-datum,
time TYPE sy-uzeit,
book_record TYPE add_t_book,
END OF type_data.
DATA: i_data TYPE type_data OCCURS 0 WITH HEADER LINE.
DATA: itab LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: cat_wa TYPE add_category ,
bk_gp_wa TYPE add_book_grp ,
bk_rec_wa TYPE add_book ,
bk_wa LIKE LINE OF i_data .
DATA: cat_tab TYPE STANDARD TABLE OF add_category ,
bk_gp_tab TYPE STANDARD TABLE OF add_book_grp ,
bk_rec_tab TYPE STANDARD TABLE OF add_book .
MOVE: '03' TO cat_wa-category_id ,
' BK GP 3' TO cat_wa-category_desc .
APPEND cat_wa TO cat_tab .
MOVE: '02' TO cat_wa-category_id ,
' BK GP 2' TO cat_wa-category_desc .
APPEND cat_wa TO cat_tab .
bk_gp_wa-book_category = cat_tab.
APPEND bk_gp_wa TO bk_gp_tab .
MOVE: '0012345678' TO bk_rec_wa-book_num ,
'OMS book' TO bk_rec_wa-short_desc .
bk_rec_wa-book_group = bk_gp_tab .
APPEND bk_rec_wa TO bk_rec_tab .
CLEAR:bk_gp_tab, cat_tab .
REFRESH :bk_gp_tab, cat_tab .
MOVE: '01' TO cat_wa-category_id ,
' BK GP 1' TO cat_wa-category_desc .
APPEND cat_wa TO cat_tab .
MOVE: '09' TO cat_wa-category_id ,
' BK GP 9' TO cat_wa-category_desc .
APPEND cat_wa TO cat_tab .
bk_gp_wa-book_category = cat_tab.
APPEND bk_gp_wa TO bk_gp_tab .
MOVE: '00123456789' TO bk_rec_wa-book_num ,
'SAP book' TO bk_rec_wa-short_desc .
bk_rec_wa-book_group = bk_gp_tab .
APPEND bk_rec_wa TO bk_rec_tab .
MOVE: sy-datum TO bk_wa-date ,
sy-uzeit TO bk_wa-time .
bk_wa-book_record = bk_rec_tab .
APPEND bk_wa TO i_data .
CLEAR: cat_wa , bk_gp_wa ,bk_rec_wa , bk_wa .
l_ixml = cl_ixml=>create( ).
l_ixml_sf = l_ixml->create_stream_factory( ).
l_document = l_ixml->create_document( ).
l_root_element = l_document->create_element( name = 'asx:abap' ).
l_root_element->set_attribute( name = 'xmlns:asx' value = 'http://www.sap.com/abapxml' ) .
l_root_element->set_attribute( name = 'version' value = '1.0' ).
l_document->append_child( new_child = l_root_element ).
others = l_document->create_simple_element( parent = l_root_element name = 'asx:values' ).
l_booklist = l_document->create_simple_element( parent = others name = 'BOOKLIST' ).
LOOP AT i_data INTO bk_wa .
CLEAR temp_string .
MOVE: bk_wa-date TO temp_string .
l_date = l_document->create_simple_element( parent = l_booklist name = 'DATE' value = temp_string ).
CLEAR temp_string .
MOVE: bk_wa-time TO temp_string .
l_time = l_document->create_simple_element( parent = l_booklist name = 'TIME' value = temp_string ).
LOOP AT bk_wa-book_record INTO bk_rec_wa .
l_book_record = l_document->create_simple_element( parent = l_booklist name = 'BOOK_RECORD' ) .
CLEAR temp_string .
MOVE: bk_rec_wa-book_num TO temp_string .
l_date = l_document->create_simple_element( parent = l_book_record name = 'BOOK_NUM' value = temp_string ).
CLEAR temp_string .
MOVE: bk_rec_wa-short_desc TO temp_string .
l_time = l_document->create_simple_element( parent = l_book_record name = 'SHORT_DESC' value = temp_string ).
l_book_group = l_document->create_simple_element( parent = l_book_record name = 'BOOK_GROUP' ).
LOOP AT bk_rec_wa-book_group INTO bk_gp_wa .
LOOP AT bk_gp_wa-book_category INTO cat_wa .
l_book_cat = l_document->create_simple_element( parent = l_book_group name = 'BOOK_CATEGORY' ).
CLEAR temp_string .
MOVE: cat_wa-category_id TO temp_string .
l_date = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_ID' value = temp_string ).
CLEAR temp_string .
MOVE: cat_wa-category_desc TO temp_string .
l_time = l_document->create_simple_element( parent = l_book_cat name = 'CATEGORY_DESC' value = temp_string ).
ENDLOOP .
ENDLOOP .
ENDLOOP .
ENDLOOP .
l_ostream = l_ixml_sf->create_ostream_xstring( xml ).
l_document->render( ostream = l_ostream ).
CREATE OBJECT l_xml.
CALL METHOD l_xml->parse_xstring
EXPORTING
stream = xml.
l_xml->render_2_string(
EXPORTING
pretty_print = 'X'
IMPORTING
RETCODE = RETCODE
stream = xml_out
size = size
CALL METHOD l_xml->display.
to read the xml data to abap itab you could parse node by node or write a XSLT to map it to your itab or use the following method. (add the following code to the earlier program)
data: result_xml type standard table of smum_xmltb .
data: return type standard table of bapiret2 .
after the statement
l_document->render( ostream = l_ostream ).
add
converting xml to itab
call function 'SMUM_XML_PARSE'
exporting
xml_input = xml
tables
xml_table = result_xml
return = return .
now check the result_xml itab.
rgds
anver -
To Find the type of field in the internal table.
I have internal table i_tab.
TYPES : BEGIN OF t_makt,
matnr TYPE matnr,
maktx TYPE maktx,
qty type mseg-menge,
show type char01,
END OF t_makt.
DATA : i_tab TYPE t_makt OCCURS 0 WITH HEADER LINE.
I want to know the type of the field of the i_tab at some stage in the program.
is there any piece of code or FM available to find the TYPE of the field of the internal table.Check out the following code
TYPES:
BEGIN OF my_struct,
comp_a type i,
comp_b type f,
END OF my_struct.
DATA:
my_data TYPE my_struct,
descr_ref TYPE ref to cl_abap_structdescr.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
START-OF-SELECTION.
descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'Typename :', descr_ref->absolute_name.
WRITE: / 'Kind :', descr_ref->type_kind.
WRITE: / 'Length :', descr_ref->length.
WRITE: / 'Decimals :', descr_ref->decimals.
WRITE: / 'Struct Kind :', descr_ref->struct_kind.
WRITE: / 'Components'.
WRITE: / 'Name Kind Length Decimals'.
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
<comp_wa>-length, <comp_wa>-decimals.
ENDLOOP. -
Adding the field in the internal table based on another field
Hi all,
I am Creating a Function module with three fields (HKONT,EBELN,DMBTR) in the output internal table(ITAB)
My Requirement is that as soon as the value of the HKONT in the internal table changes, i need to sum the DMBTR field values and should pass into a variable(v_sum).
ON CHANGE OF seems to me Obsolete.
Please help me in doing this.
Thanks
AjayHI,
Use control break event . AT END OF.
loop at ITAB.
V_DMBTR = V_DMBTR + ITAB-DMBTR.
at end of HKONT.
v_sum = V_DMBTR.
clear : V_DMBTR.
endat.
endloop.
Regards,
Srini. -
Checkbox as one of the field in the internal table in the list
Hi,
I have a requirement of processing the certain records of the internal table for which checkboxes are selected in the list.
The selected records need to be updated in the custom table and the unselected records need to be ignored.
I have created the PF status and the application tool bar and a button on the tool bar.
Then when the report is executed the list is displayed with the records with one of the field as a checkbox.
At user-command.
Then in the at user-command handling the button click event.
I want to know which records are been selected and which are not.
If some one knows please let me know.
Thanks
S PatelThis is exactly what you need to do:-
PBO
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
Select data from your table
PERFORM select_data CHANGING pt_outtab[].
Build fieldcat
PERFORM build_fieldcat CHANGING pt_fieldcat.
Exclude standard buttons from the Toolbar
PERFORM exclude_tb_functions CHANGING lt_exclude.
Display output in ALV grid
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab[].
PAI
Get modified data
CALL METHOD gv_grid->check_changed_data.
LOOP AT gt_output INTO wa_output WHERE zzchkbox EQ c_x.
MOVE-CORRESPONDING wa_output TO wa_selblk.
APPEND wa_selblk TO lt_selblk.
ENDLOOP.
This method will give you all the records which are selected in the list output. Collect them and modify your custom table.
Edited by: Rudresh Chand on Feb 28, 2010 8:26 AM -
How to add a running value from external field in a repeating table of SharePoint list
I'me creating an infopath form that will display a SharePoint list. I want to add a link control in a repeating table using the value of the first column per row but I'm getting an issue. the link control displays only the first row. thanks in advance.
Hi,
I found a similar thread posted by you here:
http://social.technet.microsoft.com/Forums/en-US/e1fa36c1-cb5c-456d-ba40-2f26301913d2/how-to-loop-through-each-row-in-a-repeating-table-using-sharepoint-workflows?forum=sharepointgeneralprevious
I suppose both the threads are reuqesting the method to get values from repeating table via workflow, so we can focus on the issue on the other case. If there is more requestment here, let me know.
Regards,
Rebecca Tu
TechNet Community Support -
How can we change value of a field in the Repeating Table using SharePoint Workflow 2013.
Hi
I have an InfoPath form published on a SharePoint Library. The form contains a Repeating table and after submit a workflow runs. In this workflow I want to change some values of the fields within Repeating table.
How can I do this?
Thanks.Hi,
I found a similar thread posted by you here:
http://social.technet.microsoft.com/Forums/en-US/e1fa36c1-cb5c-456d-ba40-2f26301913d2/how-to-loop-through-each-row-in-a-repeating-table-using-sharepoint-workflows?forum=sharepointgeneralprevious
I suppose both the threads are reuqesting the method to get values from repeating table via workflow, so we can focus on the issue on the other case. If there is more requestment here, let me know.
Regards,
Rebecca Tu
TechNet Community Support -
Value of new field in SAP internal table does not appear in HTML
There is already an existing web application. (has both SAP and HTML programs)
I only need to add one field in the SAP internal table and display the value in HTML.
I activated and pushed the publish button in SAP.
Still, it is not read successfully in HTML and therefore not displayed in the GUI.
What step did I miss?Hi,
To publish completely an internet service, try SIAC_PUBLISH_ALL_INTERNAL transaction.
Hope this helps,
Iván. -
Grouping fields of the internal table
hi all,
i ' m using an internal table, and y need to group fields like the following example:
what i have:
werks arbpl aufnr
ca01 ka mecha 1
ca01 ka mecha 1
ca01 ka li 1
ca01 ka li 1
what i need:
werks arbpl aufnr
ca01 ka mecha 2
ca01 ka li 2
can anyone help me?
Regards,
Roxana.See the below example code for Grouping all fields:
REPORT ZTEST_IEVENTS no standard page heading
line-count 40(2).
tables : vbap.
data : begin of i_vbap occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
kwmeng like vbap-kwmeng,
netpr like vbap-netpr,
end of i_vbap.
data wa_vbap like line of i_vbap.
data v_flag type c.
select-options s_vbeln for vbap-vbeln obligatory.
start-of-selection.
select vbeln
posnr
matnr
kwmeng
netpr from vbap
into table i_vbap
where vbeln in s_vbeln.
sort i_vbap by vbeln posnr.
end-of-selection.
loop at i_vbap.
move i_vbap to wa_vbap.
at first.
write:/2 'Order #',15 'Item #',28 'Material #',50 'Qty', 70 'Net value'.
skip 1.
endat.
at new vbeln.
write:/2 wa_vbap-vbeln,15 wa_vbap-posnr,28 wa_vbap-matnr,
47 wa_vbap-kwmeng,65 wa_vbap-netpr.
v_flag = 'X'.
endat.
if v_flag ne 'X'.
write:/15 wa_vbap-posnr,28 wa_vbap-matnr,
47 wa_vbap-kwmeng,65 wa_vbap-netpr.
endif.
at end of vbeln.
sum.
skip 1.
write:/5 'Sub totals', 47 i_vbap-kwmeng,65 i_vbap-netpr.
skip 1.
endat.
at last .
skip 1.
sum.
write:/5 'Grand Totals',47 i_vbap-kwmeng,65 i_vbap-netpr.
endat.
clear v_flag.
endloop. -
Sum a particular filed based on other field in the Internal table?
Hi Guys,
I am having an Internal table with G/L account number and Amount in Local Currency .so in this we will have some g/l account number's repeated with different amount.I need to add all the Amounts in the amount column with same G/L account number and make it into a single entry.so how to do this ?
Thanks,
Gopi.Hi Gopi,
declare another wa1 same as wa.
declare final_tab same as itab.
clear wa1.
sort itab by accno.
loop at itab into wa.
if wa-accno = wa1-accno.
wa-amt = wa-amt + wa1-amt.
modify final_tab from wa transporting amt.
else.
append wa to final_tab.
endif.
wa1 = wa
endloop.
Reward if it helps,
Satish -
What is the JavaScript to copy the value from a field to the clipboard?
I have a "Save As" Button scripted. But would like the button to first copy the value "SiteCode" so when the user is prompted to enter in the name they can just paste it.
Anybody got any ideas?
ThanksThat's not possible. It is possible to save to an existing folder with a filename derived from one of more field values, but the code that does that save has to be in a folder-level JavaScript file or in a certified document that the user chooses to trust for privileged JavaScript execution. So each user would have to manually install the JavaScript file or manually add the certificate to their list of trusted certificates and specify that it's trusted for privileged JavaScript execution.
I've had good success providing instructions for copying the field name from a form field so that the user can paste it as the field name in the Save As dialog that's invoked using an "Execute a menu item" action (File > Save As), so this might be a viable alternative you can use. -
Field with a default value from another field
I need to populate a field as the default value from another field that the user inputs. I've tried the scripting that I found from the below Topic in the Archived Forums, but I'm not able to make it work. I've tried numerous variations and still to no avail. I tried to make the scripting work in Acrobat 6 and then decided that maybe I needed to upgrade, so I'm now trying it in Acrobat 8 with no results. Can anyone help?
Topic
Acrobat 5 - field with default value of another field
Ben PF - 03:31am Mar 23, 2007 Pacific
How can I have a field date2 which has the default value of field date1, but which can be edited by the user if necessary without changing the value of date1.
I've tried, but I just can't figure it out!
Any help much appreciated.
Ben
| Back to Topic List | Bookmark | Subscribe
To start a NEW discussion click on the Back to Topic List link and select Add Topic.
If you are in an archive forum please go up to the main topic list (archives are read only).
Messages
2 messages. Displaying 1 through 2.
First Previous Next Last Show All Messages
Gene Dianoski - 5:22am Mar 23, 07 PST (#1 of 2)
This, or some variation of this, should work:
if(this.getField("date2").value == ""{
this.getField("date2").value = this.getField("date1).value;
| Bookmark back to top
Ben PF - 6:49am Mar 23, 07 PST (#2 of 2)
Thanks very much.
I put it in at document level to start, but it didn't run the script automatically when date1 was first filled in, so I have put it in as a mouse exit action in date1 and it works a treat.
Thanks for your help.
BenOkay forget what I posted above and lets start over. Go to your first field and under Properties -> Actions Tab -> Select Trigger -> On Blur Run A JavaScript.
Put this:
this.getField("myField2").value = event.target.value;
Make sure that you replace ("myField2") with the actual name of your second field. I just tested this and it works for Acrobat version 6.
I haven't been doing as much javascripting as I used to, so sometimes I too make some basic mistakes.
Maybe you are looking for
-
Hi, I bought on itunes Justin Biebers new album and 6 songs from the album does not work on my iphone. They do work on computer in itunes but when I synchronise PC and Iphone the Itunes tells me that "6 itunes could not be synced. See itunes for more
-
Still Frame altered in Photoshop resizes in iMovie
Hello, When I export a still frame as a pict file from iMovie and then edit that still frame in photoshop (resaved as a pict file), the file imports back into iMovie resized. It enlarges a bit more than the previous still frame. Does anyone know how
-
Inventory transfer two report preview
Dear Experts, Kindly help me upon our problem. We are generating a report for inventory transfer using our customized report that is set on default. The problem arises when we are clicking the preview 2 Report are generated, one is from our customize
-
Accounting entries during production cycle
Hi Can someone tell me what are the accounting entries that take place during production from one process to another? Where is the accounts configured? Thanks
-
Problems after Security Update 10-05
Installed today's Security Update from Software Update, restarted, and ran Permissions Repair (as usual). As usual there were several Flash/Java permissions which needed fixing, but while this was happening I kept getting a window telling me that "We