How to populate internal table field with text data?
Hello Experts,
I was able to load text file to a internal table but data is not populating each field. Can someone help me how to populate each field of internal table from text file?
Here is the text file:
io_name, io_type, io_txsht, io_txlng, io_datatype, io_length
ZEA_IO1, CHA, IO Test, IO Test 1, CHAR, 20
ZEA_IO2, CHA, IO Test, IO Test 2, CHAR, 20
Here is the Code:
*& Report ZAS_BAPI_TEST *
*& InfoObject Creation through BAPI.
*& Read the Text file, call a BAPI to create InfoObjects. *
*& Text file will hold the Info Object Structure. Text file will be *
*& located either work station or local PC.
*& Step 1. Create internal table to hold InfoObject structure *
*& Step 2. Retrieve/Load text file into Internal Table structure *
*& Step 3. Call BAPI Function to Create IO *
*& Step 4. Call BAPI Function to Activate IO *
REPORT ZAS_BAPI_TEST .
Make data separator a comma
CONSTANTS: gc_tab TYPE c VALUE ','.
Declaring Internal table for creating InfoObject
DATA: p_file TYPE string.
DATA: BEGIN OF itab-bapi OCCURS 0,
io_name like BAPI6108-infoobject,
io_type like BAPI6108-type,
io_txsht like BAPI6108-textshort,
io_txlng like BAPI6108-textlong,
io_datatype like BAPI6108-datatp,
io_length like BAPI6108-intlen,
END OF itab-bapi.
DATA ibapi LIKE STANDARD TABLE OF itab-bapi.
PARAMETERS: sel_file(1500) TYPE c default ' ' OBLIGATORY LOWER CASE.
PUT THE TEXT FILE PATH TO P_FILE
p_file = sel_file.
Copy the file from the workstation to the server ****
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = SPACE
HEADER_LENGTH = 0
DAT_MODE = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab-bapi[]
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MESSAGE e012(zea_spms) WITH 'Method' 'GUI_UPLOAD' sy-subrc.
&1 &2 issued return code &3
ELSE.
pit_data[] = lit_data[].
ENDIF.
ENDIF.
loop at itab-bapi.
write: /5 itab-bapi-io_name,
20 itab-bapi-io_type,
30 itab-bapi-io_txsht,
50 itab-bapi-io_txlng,
75 itab-bapi-io_datatype,
85 itab-bapi-io_length.
endloop.
SELECT THE LOCATION FOR TEXT FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ''
def_path = 'C:\'
mask = ',Documentos de texto (*.txt), *.txt.'
mode = ''
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
find '.txt' IN p_file.
if sy-subrc <> 0.
concatenate p_file '.txt' into sel_file.
else.
sel_file = p_file.
endif.
Create InfoObject through BAPI Function
*CALL FUNCTION 'BAPI_IOBJ_CREATE'.
*IMPORTING
VALUE(DETAILS) LIKE BAPI6108 STRUCTURE BAPI6108
*EXPORTING
VALUE(INFOOBJECT) LIKE BAPI6108-INFOOBJECT
VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
TABLES
COMPOUNDS STRUCTURE BAPI6108CM OPTIONAL
ATTRIBUTES STRUCTURE BAPI6108AT OPTIONAL
NAVIGATIONATTRIBUTES STRUCTURE BAPI6108AN OPTIONAL
ATRNAVINFOPROVIDER STRUCTURE BAPI6108NP OPTIONAL
HIERARCHYCHARACTERISTICS STRUCTURE BAPI6108HC OPTIONAL
ELIMINATION STRUCTURE BAPI6108IE OPTIONAL
RETURNTABLE STRUCTURE BAPIRET2 OPTIONAL
Activate InfoObject through BAPI Function
CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
*ENDFORM. " RETRIEVE_DATASET
I appreciate your help.
Regards,
Mau
I have used tab delimited file.
Here are file contents
io_name io_type io_txsht io_txlng io_datatype io_length
ZEA_IO1 CHA IO Test IO Test 1 CHAR 20
ZEA_IO2 CHA IO Test IO Test 2 CHAR 20
And here is program used
*& Report ZAS_BAPI_TEST *
*& InfoObject Creation through BAPI.
*& Read the Text file, call a BAPI to create InfoObjects. *
*& Text file will hold the Info Object Structure. Text file will be *
*& located either work station or local PC.
*& Step 1. Create internal table to hold InfoObject structure *
*& Step 2. Retrieve/Load text file into Internal Table structure *
*& Step 3. Call BAPI Function to Create IO *
*& Step 4. Call BAPI Function to Activate IO *
REPORT ZAS_BAPI_TEST .
Make data separator a comma
CONSTANTS: gc_tab TYPE c VALUE ','.
Declaring Internal table for creating InfoObject
DATA: p_file TYPE string.
DATA: BEGIN OF itab-bapi OCCURS 0,
io_name like BAPI6108-infoobject,
io_type like BAPI6108-type,
io_txsht like BAPI6108-textshort,
io_txlng like BAPI6108-textlong,
io_datatype like BAPI6108-datatp,
io_length like BAPI6108-intlen,
END OF itab-bapi.
DATA ibapi LIKE STANDARD TABLE OF itab-bapi.
PARAMETERS: sel_file(1500) TYPE c default ' ' OBLIGATORY LOWER CASE.
PUT THE TEXT FILE PATH TO P_FILE
p_file = sel_file.
Copy the file from the workstation to the server ****
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file
<b>FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'</b>
TABLES
data_tab = itab-bapi[]
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MESSAGE e012(zea_spms) WITH 'Method' 'GUI_UPLOAD' sy-subrc.
&1 &2 issued return code &3
ELSE.
pit_data[] = lit_data[].
ENDIF.
ENDIF.
loop at itab-bapi.
write: /5 itab-bapi-io_name,
20 itab-bapi-io_type,
30 itab-bapi-io_txsht,
50 itab-bapi-io_txlng,
75 itab-bapi-io_datatype,
85 itab-bapi-io_length.
endloop.
SELECT THE LOCATION FOR TEXT FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ''
def_path = 'C:\'
mask = ',Documentos de texto (*.txt), *.txt.'
mode = ''
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
find '.txt' IN p_file.
if sy-subrc <> 0.
concatenate p_file '.txt' into sel_file.
else.
sel_file = p_file.
endif.
Create InfoObject through BAPI Function
*CALL FUNCTION 'BAPI_IOBJ_CREATE'.
*IMPORTING
VALUE(DETAILS) LIKE BAPI6108 STRUCTURE BAPI6108
*EXPORTING
VALUE(INFOOBJECT) LIKE BAPI6108-INFOOBJECT
VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
TABLES
COMPOUNDS STRUCTURE BAPI6108CM OPTIONAL
ATTRIBUTES STRUCTURE BAPI6108AT OPTIONAL
NAVIGATIONATTRIBUTES STRUCTURE BAPI6108AN OPTIONAL
ATRNAVINFOPROVIDER STRUCTURE BAPI6108NP OPTIONAL
HIERARCHYCHARACTERISTICS STRUCTURE BAPI6108HC OPTIONAL
ELIMINATION STRUCTURE BAPI6108IE OPTIONAL
RETURNTABLE STRUCTURE BAPIRET2 OPTIONAL
Activate InfoObject through BAPI Function
CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
*ENDFORM. " RETRIEVE_DATASET
This program is working fine. You can test it.
Only problem is as the column headings are big for some columns, they are getting truncated which you can always change by changing the column width in declaration
Please let me know if this helps.
ashish
Similar Messages
-
How to Populate Internal table data to Table Control in a Report Program
Dear All,
How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
Thanks in Advance,
Joseph ReddyIf you want to use a table control, you will need to create a screen.
In your report....
start-of-selection.
perform get_data. " Get all your data here
call screen 100. " Now present to the user.
Double click on the "100" in your call screen statement. This will forward navigate you to the screen. If you have not created it yet, it will ask you if you want to create it, say yes. Go into screen painter or layout of the screen. Use the table control wizard to help you along the process. It will write the code for you. Since it is an output only table control, it will be really easy with not a lot of code.
A better way to present the data to the user would be to give it in a ALV grid. If you want to go that way, it is a lot easier. Here is a sample of the ALV function module. You don't even have to create a screen.
report zrich_0004
no standard page heading.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: begin of imara occurs 0,
matnr type mara-matnr,
maktx type makt-maktx,
end of imara.
* Selection Screen
selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for imara-matnr .
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform write_report.
* Get_Data
form get_data.
select mara~matnr makt~maktx
into corresponding fields of table imara
from mara
inner join makt
on mara~matnr = makt~matnr
where mara~matnr in s_matnr
and makt~spras = sy-langu.
endform.
* WRITE_REPORT
form write_report.
perform build_field_catalog.
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = imara.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Number'.
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material'.
fc_tmp-fieldname = 'MAKTX'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '40'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
endform.
Regards,
Rich Heilman -
How to add internal table fileds in Text module in smart forms
Hi Friends,
How to add internal table fileds in Text module in smart forms?
Thanks & Regards,
Vallamuthu.MHi Vallamuthu ,
how did you solve your problem?
thanks, -
How to populate dynamic internal table fields with data??
Hi Folks,
How to assign a particular internal table field to a dynamically assigned internal table?
I have an excel sheet, and i upload the excel sheet data into an internal IT_EXLOAD table using FM ALSM_EXCEL_TO_INTERNAL_TABLE
Now i created a dynamic internal table which has the same column as in my DB table.
I have to fill the dynamically created Internal table with the IT_EXLOAD data dynamically.
Suppose in future if i add some field in DB table and for that field if i add some column in excel sheet there is no need to change in the program.
Looking for reply...
Best Regards,
Sayakhi,
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_path
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '2'
i_end_row = '1000'
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
*declare intern_tmp as internal table tb_data in wich you want the data
*and declare a field symbol <fs_123>
LOOP AT intern.
ASSIGN COMPONENT intern-col OF STRUCTURE
intern_tmp TO <fs_123>.
IF NOT <fs_123> IS ASSIGNED.
CLEAR intern.
CLEAR intern_tmp.
CONTINUE.
ENDIF.
<fs_123> = intern-value.
AT END OF row.
CLEAR tb_data.
MOVE-CORRESPONDING: intern_tmp TO tb_data.
APPEND tb_data.
CLEAR intern_tmp.
ENDAT.
CLEAR intern.
ENDLOOP.
**paste this code and you can see the data in ur tables dynamically.
Thanks
Nitin Sachdeva -
How to bind internal table values with RootUIElement(Table) from select Que
Hello Friends,
In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...
I written coding also but i dont know to bind internal table values with Table... My code as follows,
method onactionsearch .
data:
Node_Node_Flight type ref to If_Wd_Context_Node,
Elem_Node_Flight type ref to If_Wd_Context_Element,
Stru_Node_Flight type If_View1=>Element_Node_Flight ,
itab TYPE STANDARD TABLE OF sflight.
navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
@TODO handle not set lead selection
if ( Node_Node_Flight is initial ).
endif.
get element via lead selection
Elem_Node_Flight = Node_Node_Flight->get_Element( ).
@TODO handle not set lead selection
if ( Elem_Node_Flight is initial ).
endif.
alternative access via index
Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).
@TODO handle non existant child
if ( Elem_Node_Flight is initial ).
endif.
get all declared attributes
Elem_Node_Flight->get_Static_Attributes(
importing
Static_Attributes = Stru_Node_Flight ).
select * from sflight into CORRESPONDING FIELDS OF TABLE itab
WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.
Node_Node_Flight->bind_table( new_items = itab ).
endmethod.
Plz reply me asap...!Hi,
What I understood from your coding is...
* navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
You are reading values from the above node and binding the values to the same node.Am i right?
Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.
One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.
Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.
Go throgh this link
Web Dynpro for ABAP: Tutorials for Beginners
Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM -
How can I add table fields with existing structure ?
I like to add PSTLZ field to stucture KOMGG.Is it possible to add table field with the existind structure.If yes how can I do this?kindly help me on this.
hi
go to se11
in change mode select the button append
create new append which starts from Zpstlz in this komgg structure and add data element and domain to this field and activate with request number
then in field catalogue this field should be visible ,here ends your append
now it is ready to use in condition tables.
reward if helps !!!!! -
How to populate BusinessObjects metadata repository with .xml data?
Can we populate BusinessObjects metadata Repository with .xml data? If yes can you please share some document or link on how to do that?
Can we populate BusinessObjects metadata Repository with .xml data? If yes can you please share some document or link on how to do that?
-
How to populate custom table field value into standard DFF
Hi Gurus
I am newbie to the OAF
I have a requirement to populate the custom table field value into standard DFF. we enabled the DFF in ReqDistDFFOnAcct(po_req_distributions_all). On the requisition tab as soon as i click on the checkout button, the custom field value has to be shown in the requisition distributions DFF field along with the standard Columns like charge account, percent, qty and when we click on the next button, it has to hit the base table ie., po_req_distributions_all.
the standard columns data is showing the screen. how to acheive this requirement programatically
There is a EO for the req distributions table. please help me how to achevie this requirement.
Any help woud be greatly appreciated.
Thank You!
KrishnaThanks Aj. Finally i made some progress....but i am getting an error in the inst_top OPMN folder 10/10/08 15:37:14 Error: <connector name="OracleASjms" path="OracleASjms.rar" /> will not be bootstrapped since corresponding module declaration was not found in application.xml. I cleared the cache, bounced the webserver. Could not able to understand what is this error
Following is the code that i have written. I am not able to find out what is the error. please help me how to fix this error. there is no changes in the page and the value is not auto populating. the page is having the normal behaviour as the standard one.
Thanks in Advance for your help...
public class xxCheckoutDistsCO extends CheckoutDistsCO
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
String UnitId="";
//First get the Application Module
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject)am.findViewObject("PoRequisitionLinesVO");
String Reqlineid="";
String Linenum="";
String DeliverLoc="";
if(vo.first() !=null)
Reqlineid= vo.first().getAttribute("RequisitionLineId").toString();
Linenum = vo.first().getAttribute("LineNum").toString();
DeliverLoc = vo.first().getAttribute("DeliverToLocationId").toString();
// if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
// pageContext.writeDiagnostics("TEST >", Reqlineid,1);
// pageContext.writeDiagnostics("TEST >", Linenum,2);
// pageContext.writeDiagnostics("TEST >", DeliverLoc,3);
UnitId=null;
String Querry="select amli_icx_oaf_utils.get_blding_unit_id (?,?,?) from dual";
try
PreparedStatement ps=am.getOADBTransaction().getJdbcConnection().prepareStatement(Querry);
ps.setInt(1,Integer.parseInt(Reqlineid));
ps.setInt(2,Integer.parseInt(Linenum));
ps.setInt(3,Integer.parseInt(DeliverLoc));
ResultSet rs=ps.executeQuery();
// ps.execute();
// am.getOADBTransaction().commit();
while (rs.next())
System.out.println(" Query Results ");
UnitId= rs.getString(1);
System.out.println(" first > ");
rs.close();
ps.close();
catch(SQLException a)
System.out.println(" Error "+a);
System.out.println(" Second > ");
System.out.println(" Third > "); ----the program is executing upto here...it is not setting the value after this.
OAViewObject povo = (OAViewObject)am.findViewObject("PoReqDistributionsVO");
if(povo.getCurrentRow()!=null ) --------If i remove this condition i am getting the nullpointer exception in page.....
System.out.println(" Fourth > ");
povo.getCurrentRow().setAttribute("Attribute12",UnitId);
// if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
// pageContext.writeDiagnostics("TEST >", UnitId, 1);
Thanks
krishna -
Populating internal table field with same value
Is there syntax that will fill a field value in every record in an internal table without looping?
Hi Rob,
I didn't know this, after studying online help on MODIFY itab, ABAP Statement
MODIFY itab - itab_lines
Syntax
... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
I tried
DATA:
ls_t100 TYPE t100,
lt_t100 TYPE TABLE OF t100.
SELECT * INTO TABLE lt_t100 FROM t100 UP TO 20 ROWS.
MODIFY lt_t100 FROM ls_t100 TRANSPORTING text where text <> ls_t100-text .
clears field text in all rows of lt_t100.
after many years of field-symbols finally a reason to use MODIFY again
Regards,
Clemens -
How to check which Table & Field is populating Data source
Hi,
My requirment is to check from which Table and Which field the data is extracted in the data source
Data Source : 0MAT_PLANT_ATTR
Field in Data Source : MINBE
Now i want to check from where (Table/Field) in R/3 is populating the Field MINBE in Data source 0MAT_PLANT_ATTR
How can i do thatHi,
Since you have the extract structure and the extractor, you can try Extractor Checker RSA3.Execute ST05 (activating SQL Trace), switch on the trace and execute the extractor checker. Once the extractor checker presents the results
switch off trace. The clcik on Display trace and you will see all the tables that were hit by the extractor checker to retrieve data and present it to you.
Note: Set the break point in the Extractor Function module.
View the ST05 Extended Trace list. The Object name shows the Tables accessed.
Hope this helps.
Thanks,
JituK -
How to populate a table column with marked text?
I hate searching and typing so I was just wondering if there was a solution to the following problem.
I have a document that contains 5-character defect codes in the body of the text (in numbered steps). At the end of the document I have a table which summarizes these codes: the codes make up one column and the other columns contain information related to these codes (page number, area, actions to be taken, criteria for defect etc.).
Is there a way for me to mark the codes such that I could import all of them into the defect code column?
I was leaning towards generating a list of some kind and then pasting it in the column but I can't seem to paste my generated list into multiple cells. FM will only allow me to paste the whole list in one cell. Am I using the wrong approach or maybe missing a step in between?Thank you! that was very helpful and it solves my problem to a great degree. I didn't think of converting the list to a table--now I just have to delete the page numbers, since they are included in the table, but in another column
FYI, I couldn't use cross-reference markers because the defect code (according to the style guide.) is written at the end of the instruction, on the same line without a hard return. Cross referencing brought in all the text in that paragraph if I used a <paratext> building block to define my cross-reference format. I lack the knowledge to create a cross-reference format that would just give me the last five characters of the paragraph. These tables tend to be long and even if I could do that, for each row, I would have to click about seven or eight times per entry
Thanks again. -
How to find internal table fields from which table.
Hello Experts,
I have to use a dynamic select inner join query.
SELECT (lv_string)
FROM (from_tab)
INTO CORRESPONDING FIELDS OF TABLE <fs_itab1>
WHERE (where_tab).
ELSEIF table_1 NE ''.
SELECT *
FROM (table_1)
INTO CORRESPONDING FIELDS OF TABLE <fs_itab1>
WHERE (where_tab).
in that LV_string is dynamicaly select. from a structure which is a combination of say VBAK and VBAP
i have to
CONCATENATE 'VBAK~' wa_fields-fname INTO str_temp.
CONCATENATE lv_string str_temp INTO lv_string SEPARATED BY space
CONCATENATE 'VBAP~' wa_fields-fname INTO str_temp.
CONCATENATE lv_string str_temp INTO lv_string SEPARATED BY space.
with there identifire....how to find that...
Regards,
Ketan.Ketan,
I believe you CAN find this only when you are creating lv_string from your structure (or whatever it is).
So paste that code that what is your 'structure' type and on what conditions you want to Fill lv_string from it.
in that LV_string is dynamicaly select. from a structure which is a combination of say VBAK and VBAP
If you have a custom or standard Structure from which you need to fill lv_string, then you should have no worries to full VBAK~ or VBAP~ because fieldnames will be always unique in any Structure and hence ~ additions are not necessarily needed.
The issue can be in the case where you are picking few fields each from std tables VBAK and VBAP in your lv_string and
your "(from_tab)" is an inner join condition. I believe in that case you should be able to identify VBAK~ and VBAP~ while populating lv_string itself. Also you can use DB view MASSVBAP.
Regards,
Diwakar -
How to populate 2 screen-fields with one [ON VALUE-REQUEST FOR input] evnt?
I have a selection screen with 2 text inputs - input1, input2.
For the first one I have an "AT SELECTION-SCREEN ON VALUE-REQUEST FOR input1" event.
I successfully get a value there and that is set to the screen field. But I also want input2 to be automatically populated with a value corresponding to the selected input1 (eg. input1=ID, input2=Name).
I'm able to set input2 ABAP variable but not the screen-element.
(I guess that ON VALUE-REQUEST doesn't fire any events for screen fields update, because if I press ENTER after using my search-help, then input2 is set with the right value)
How to solve the problem?Hi Ramchander,
Actually I used FM F4IF_FIELD_VALUE_REQUEST which doesn't have mapping parameters.
But after your advice I looked through F4IF_INT_TABLE_VALUES_REQUEST and found that it's
DYNP_VALUES_UPDATE FM that solves my task.
Thanks! -
How to populate internal table( varaible of ABAP table type) in Excel VBA?
Hi,
I am trying to update a database table from excel using a VBA Macro.
I am able to connect to SAP and able to read data from SAP using a RFC. Similarly after updating certain values, i want to update a table in SAP.
Below are the steps I am doing apart from basic settings.
Getting the reference of the SAP TABLE type from RFC fucntion module
' Call RFC
Set MyFunc = R3.Add("UPDATE_TVARVC_VIA_RFC")
' Get reference and Values TVARVC
Set oParam4 = MyFunc.Tables("TVARVC")
2. Loop over the active cells and populate oParam4
" add values as below
oParam4.Rows.Add
oParam4.Value(1, "NAME") = ..................
oParam4.Value(1, "TYPE") = ..................
oParam4.Value(1, "NUMB") = ..................
Do it for all columns in the table line.
My query is how to identify active cells and make the above code dynamic in step 2.
Thanks in Advance,
Best,
AneelHi Aneel,
You can try the following:
e.g.
for j = 1 to ActiveCell.SpecialCells(11).Column
oParam4.Rows.Add
if j=1 then oParam4.Value(j, "NAME") = ActiveSheet.Cells(1,j).Value
if j=2 then oParam4.Value(j, "TYPE") = ActiveSheet.Cells(1,j).Value
if j=3 then oParam4.Value(j, "NUMB") = ActiveSheet.Cells(1,j).Value
next j
Regards,
ScriptMan -
hii all,
my code is according this..................
the three KEY field which is commom in IT_CDPOS & IT_CDHDR are
1. objectclass = 'VBERCGH'
2. tabname = 'VBAP'
3.changind = 'U'.
loop at it_cdpos into wa_cdpos.
z_var = wa_cdpos-tabkey.
wa_cdhdr-vbeln = z_var+3(10).
wa_cdhdr-posnr = z_var+13(6).
modify it_cdhdr from wa_cdhdr transporting vbeln posnr.
endloop.
now the problem is that when i execute the code DUMP is come due to modify statement.
apart from that if i use in place of MODIFY......
APPEND.
Data will move but not in proper position.like it appends from the last position.
As IT_CDHDR has data before this code.
so according the data that IT_CDHDR contain i want to move vbeln and posnr value in IT_CDHDR at correct position.
Please provide me the suitable code for that......
thanks
Babbal.Hi,
data l_idx type sy-tabix.
loop at it_cdpos into wa_cdpos.
*Read table it_cdhdr into wa_cdhdr with key objectclass = wa_cdpos-objectclass*
* tabname = wa_cdpos-tabname*
*changind = wa_cdpos-changind*
if sy-subrc = 0.
*l_idx = sy-tabix.*
z_var = wa_cdpos-tabkey.
wa_cdhdr-vbeln = z_var+3(10).
wa_cdhdr-posnr = z_var+13(6).
modify it_cdhdr from wa_cdhdr transporting vbeln posnr *index l_idx.*
clear l_idx.
endif.
endloop.
Edited by: Kamesh Bathla on Aug 14, 2008 4:24 PM
Maybe you are looking for
-
I created a custom web part that I have deployed, but when I tried to add it to my web parts page, I first got the error that the said "a web part or web form control on this page cannot be displayed or imported. the type is not registered as safe".
-
API Not returning all RTMP ingest endpoints
The web portal shows both URLs for RTMP rtmp://etcetc.channel.mediaservices.windows.net:1935/live/... rtmp://etcetc.channel.mediaservices.windows.net:1936/live/... but the API (ex - myChannel.Input.Endpoints) only returns a single one (...:1935). Any
-
JDriver for microsoft sql server 2000
"Hi, Currently, I am using your JDriver for microsoft SQL server 2000 for evaluation purposes and confront the following problem: (1) using utils.dbping C:\student\work>java utils.dbping mssqlserver4 sa "" ywu**** Success!!! ****You can connect to th
-
Selective Deletion - can the job be stopped?
Hello experts, we are facing this issue: a selective deletion of approx. 5000 records out of 15 million records was carried out in a cube last friday. We can see the background job is still running. This is the first time we are doing a selective del
-
Understanding Installed Applications on OSX
I'm new with a Macbook Pro. I am a pure Linux user and now I'm working on a nice shiny new Macbook Pro running 10.8.3. I tried to download PostgreSQL 9 for my Macbook Pro. I double clicked the PostgreSQL 'dmg' file I downloaded. I then got a new wind