CMD executions in table class interface via ABAP
Hi SDN Community,
Would it be possible to code in ABAP , and Command statements that can be placed in the web templates.
can this be done in the Table class interface.
For example, the command to expand a hierarchy node that is produced in RSRT2, is
CMD=SET_DRILL_STATE&DATA_PROVIDER=DP=234D5W1FC9W6311O66UCVSRN9E2&IOBJNM=4D5W27AIW32VTOY02REHCSL6Y&TOGGLE_STATE=X
How can this if possible be placed in a Table Class Interface, and coded in ABAP to achieve the expansion of the hierarchy node.
thank you.
Simon
Hi Thomas,
I have been working with a brilliant ABAP'er, and together we
implemented a solution in the START method, that makes use of the
following methods and expands all the hierarchy nodes at start.
And this class can be omitted in the Print all view we have formulated
as only a collapsed view has been specified there.
thank you.
Simon
I found this all in that class interface CL_RSR_REQUEST
for N_R_REQUEST
for N_R_DATA_SET
Initial Value: Set Drilldown State of a Hierarchy
Description: 'SET_DRILL_STATE'
this looks like the method that gets executed. what do you think?
can you code this in the program
constants C_CMD_SET_DRILL_STATE type RSRCMDID
value 'SET_DRILL_STATE'. "#EC NOTEXT
methods SET_DRILL_STATE
importing
value(I_AXIS) type RRXAXIS optional
value(I_POSITION) type I optional
value(I_FOCUS_IOBJNM) type RSIOBJNM optional
value(I_DRILLSTATE) type RRXDRILLSTATE optional
value(I_TOGGLE) type RS_BOOL default RS_C_FALSE
!I_R_PARAMETER type ref to CL_RSR_PARAMETER optional
exporting
!E_KEEP_LAST_LINES type I
!E_KEEP_FIRST_LINES type I
!E_NEW_LINES_FROM type I
!E_NEW_LINES_TO type I
!E_NODE_POSITION_FROM type I
!E_NODE_POSITION_TO type I
exceptions
NO_PROCESSING
X_MESSAGE .
Similar Messages
-
Red Font Color in Table Class Interface
Hi SDN community,
Do you know what the exact ABAP Syntax in the Table Class interface, and in which METHOD we would place to change the font colour of numbers to red colour.
And would be also possible to change the number to have brackets around it, to make it proper accounting notation.
I would not want to lose context sensitivity of the numbers.
Thank you.
SimonHi SDN community,
Thanks to our ABAP guru:
method data_cell.
call method super->data_cell
exporting
i_x = i_x
i_y = i_y
i_value = i_value
i_display_value = i_display_value
i_numerical_scale = i_numerical_scale
i_numerical_precision = i_numerical_precision
i_currency = i_currency
i_unit = i_unit
i_alertlevel = i_alertlevel
i_is_sum = i_is_sum
changing
c_cell_id = c_cell_id
c_cell_content = c_cell_content
c_cell_style = c_cell_style
c_cell_td_extend = c_cell_td_extend.
data: li_display_value type rsr_pnnn.
data:
lv_len type i,
lv_replace_value type char40,
lv_with_value type char40.
if i_value lt 0.
data:
amount type p decimals 2,
correctamount type p decimals 2,
chars(5) type c value '1.005'.
correctamount = chars.
write i_display_value to lv_replace_value
no-sign decimals i_numerical_precision.
condense lv_replace_value no-gaps.
if i_value < 0.
concatenate '-' lv_replace_value '</a>' into lv_replace_value.
condense lv_replace_value no-gaps.
lv_with_value = lv_replace_value.
replace:
'-' with '(' into lv_with_value,
'</a>' with ')</font></a>' into lv_with_value.
else.
concatenate lv_replace_value '</a>' into lv_replace_value.
condense lv_replace_value no-gaps.
lv_with_value = lv_replace_value.
replace '</a>' with '</font></a>' into lv_with_value.
endif.
concatenate '<font color=red>' lv_with_value into lv_with_value.
lv_len = strlen( lv_replace_value ).
replace lv_replace_value(lv_len) with lv_with_value
into c_cell_content.
endif. -
Table class interface to replace Not assigned with blank
Hi,
I have some of the values for characterstic as Not assigned I wan to replace it with blank in my webreport
when I want to replace #with blank I have written the following code
In method CHARACTERISTIC_CELL I have written th following code
IF I_CHAVL EQ '#'.
replace '#' with '-' into c_cell_content.
replace '#</a>' with '-</a>' into c_cell_content.
ENDIF.
but when I wan tot replace Not assigned with blank witht the following code its not working
IF I_CHAVL EQ 'Not assigned'.
replace 'Not assigned' with '-' into c_cell_content.
replace 'Not assigned</a>' with '-</a>' into c_cell_content.
ENDIF.See SDN-thread "Re: Remove 'Not assigned" in which you should modify the text elements in SAPLRRSV
(do not know, if this works; it is a modification which affects the whole system).
Ideas from SDN research:
"a solution i have used is to put each RKF column in a CKF colum then in each CKF use RKF + 0, the outcome is that your # should now be 0s, in the query properties you can set the option to display 0s as blank."
"try to enter a text for the blank entry in the master data maintenance of the relevant objects and set the display option for the objects to 'text'."
Threads:
SDN: How to replace # or Not assigned with blank in BEx Query Output.
SDN: Re: Remove 'Not assigned
SDN: How to replace # or (Not assigned) with blank in BEx Query Output.
SDN: Bex Analyzer : Text element system's table ?
SDN: change message in web application designer ["nonavailable" -> 136 of SAPLRRSV]
SDN: Not Assigned ["Not Assigned -> 027 of SAPLRRSV]
SDN: replacing '#'-sign for 'not assigned' in queries
SDN: # in report when null in the cube
SDN: How to replace '#' with blank when there is no value for a date field
Edited by: Thomas Köpp on Sep 13, 2010 5:18 PM -
Hi SDN Community,
We had a brilliant ABAP'er who developed the following code in table class SE24 in SAP BW.
But he is gone now!
I would like to adapt this same code to the START Method instead of the INIT Method.
But I am unfamiliar with ABAP,
and I simply tried changing CALL METHOD SUPER->START for the 7th line.
However these calls are not in the START method.
Would anyone know how to call this method from the INIT Method (via the START method), or to adapt the code
Thank you.
Simon
method INIT .
data:
ls_mem_int type rrx_mem_int,
lt_mem_int type standard table of rrx_mem_int,
lv_posn type i,
lv_offset type i,
lv_line_to type i.
CALL METHOD SUPER->INIT
EXPORTING
I_R_PAGE = i_r_page
I_R_DATA_SET = i_r_data_set
I_R_ITEM = i_r_item
I_R_GRID = i_r_grid.
data: txt_symbols_set type RRWS_S_TEXT_SYMBOLS.
data: txt_symbols_set1 type RRWS_S_TEXT_SYMBOLS.
data:
ld_fiscper type RRXSYMVALUE,
ls_reptname type RRXSYMVALUE.
Retrieve I_R_DATA_SET values for web page.
READ TABLE I_R_DATA_SET->N_SX_VERSION_20A_1-TXT_SYMBOLS WITH KEY
SYM_NAME = 'VARVALUE_ZP_FPER' INTO txt_symbols_set.
ld_fiscper = txt_symbols_set-SYM_VALUE.
L_FPER = ld_fiscper.
IF NOT L_FPER = ''.
READ TABLE I_R_DATA_SET->N_SX_VERSION_20A_1-TXT_SYMBOLS WITH KEY
SYM_NAME = 'REPTNAME' INTO txt_symbols_set1.
ls_reptname = txt_symbols_set1-SYM_VALUE.
L_FILTER = ls_reptname.
Only want to do this once for expansion of hierarchy nodes
if l_expanded is initial.
loop at n_r_data_set->n_r_request->n_sx_request-mem_int into ls_mem_int
where drillstate = 'C'
and hry_posit <> 0.
lv_posn = ls_mem_int-hry_posit.
call method n_r_data_set->n_r_request->set_drill_state
exporting
i_axis = 'Y'
i_position = lv_posn
i_drillstate = 'C' "ls_mem_int-drillstate
i_toggle = rs_c_true
importing
e_new_lines_to = lv_line_to
exceptions
no_processing = 1
x_message = 2
others = 3.
append ls_mem_int to lt_mem_int.
endloop.
Sites, Hay Point, Goonyella-Ex U/G or Broadmeadow
if l_filter = 'ZR_CPPM_M51_BMA_MSREVIEW_01FY' OR
l_filter = 'ZR_CPPM_M51_BMA_MSREVIEW_03FY' OR
l_filter = 'ZR_CPPM_M51_BMA_MSREVIEW_05FY' OR
l_filter = 'ZR_CPPM_M51_BMA_MSREVIEW_07FY'.
do 2 times.
First pass for Budget, second for variance. We are assuming hierarchy will be indentical.
lv_offset = lv_line_to.
loop at lt_mem_int into ls_mem_int.
lv_posn = ls_mem_int-hry_posit + lv_offset.
call method n_r_data_set->n_r_request->set_drill_state
exporting
i_axis = 'Y'
i_position = lv_posn
i_drillstate = ls_mem_int-drillstate
i_toggle = rs_c_true
importing
e_new_lines_to = lv_line_to
exceptions
no_processing = 1
x_message = 2
others = 3.
endloop.
enddo.
endif.
l_expanded = 'X'.
endif.
ENDIF.
endmethod.Hi Simon,
You didn't mention about the interfaces of this two class. Two because there is a inheritance mechanism. Trying to call SUPER->INIT you informing the system that you want to call method INIT from second class (which is inherited).
Same situation is when you call SUPER->START. In this case you want to call start method from second class.
If in main class you have START you should just use ME->START or CALL METHOD START commands, but of course it depends on the context ...
Daniel. -
How to create internal table storing instances of ABAP class
Hi experts, any one knows how to create internal table storing instances of ABAP class or alternative to implement such function?
Hi
Please see below example from ABAPDOCU, this might help you.
Internal Table cnt_tab is used to store class objects.
Regards,
Vishal
REPORT demo_objects_references.
CLASS counter DEFINITION.
PUBLIC SECTION.
METHODS: set IMPORTING value(set_value) TYPE i,
increment,
get EXPORTING value(get_value) TYPE i.
PRIVATE SECTION.
DATA count TYPE i.
ENDCLASS.
CLASS counter IMPLEMENTATION.
METHOD set.
count = set_value.
ENDMETHOD.
METHOD increment.
ADD 1 TO count.
ENDMETHOD.
METHOD get.
get_value = count.
ENDMETHOD.
ENDCLASS.
DATA: cnt_1 TYPE REF TO counter,
cnt_2 TYPE REF TO counter,
cnt_3 TYPE REF TO counter,
cnt_tab TYPE TABLE OF REF TO counter.
DATA number TYPE i.
START-OF-SELECTION.
CREATE OBJECT: cnt_1,
cnt_2.
MOVE cnt_2 TO cnt_3.
CLEAR cnt_2.
cnt_3 = cnt_1.
CLEAR cnt_3.
APPEND cnt_1 TO cnt_tab.
CREATE OBJECT: cnt_2,
cnt_3.
APPEND: cnt_2 TO cnt_tab,
cnt_3 TO cnt_tab.
CALL METHOD cnt_1->set EXPORTING set_value = 1.
CALL METHOD cnt_2->set EXPORTING set_value = 10.
CALL METHOD cnt_3->set EXPORTING set_value = 100.
DO 3 TIMES.
CALL METHOD: cnt_1->increment,
cnt_2->increment,
cnt_3->increment.
ENDDO.
LOOP AT cnt_tab INTO cnt_1.
CALL METHOD cnt_1->get IMPORTING get_value = number.
WRITE / number.
ENDLOOP. -
Outbound interface using ABAP Proxy
Hi Guys,
I am trying to create an interface between a Z table and XI using ABAP Proxy. I suggested file based interface, but client is insisting using ABAP proxy. Z table is in IS-Retail side.
I will appreciate is somebody can share a program to do this.
Any advise/guidance is appreciated.
Thanks,Hi There
From your subject line i can see that you want to develop an outbound proxy which means you want to send data to XI from your SAP custom table. That means you need to extract all the information from your Z-table and send it to XI via proxy.
If my understanding is correct then what you need to do is :
1.Ask your XI team team to generate a message interface for you of type 'outbound' and include the structure in the way they want you to send data to them.
2.Once the message interface is created by them , you can generate the same in transaction SPROXY . Search for your interface namespace and then right click
on it and say 'CREATE' . Give the appropriate package and prefix to it.Generate the proxy, save and activate
3. Now you can create a report and then according to the structure generated by XI , you can popluate your internal table to be passed back.
4. Call the method of the proxy in your report and send the data to XI.
I can give you an example of how to do this:
suppose you have built up an internal table by extracting data from your Z-table .Lets say it is tbl_output.
In your report you need to trigger the proxy method as follows:
Note: i am assuming i am triggering an asynchronous proxy method from my report:
DATA:lo_senddata TYPE REF TO CL_DATA_OUT,
lo_system_fault TYPE REF TO cx_ai_system_fault,
lo_root TYPE REF TO cx_root.
ls_output-output_file-data[] = tbl_data[].
CREATE OBJECT lo_senddata
TRY.
* call the asynchronous method of the proxy and send the data
CALL METHOD lo_senddata->execute_asynchronous
EXPORTING
output = ls_output.
* get the system exceptions and display the error text
CATCH cx_ai_system_fault INTO lo_system_fault.
WRITE:/ 'System Error:'(E01),
lo_system_fault->errortext.
RETURN.
* get the root exception and display the textid value
CATCH cx_root INTO lo_root.
WRITE:/ 'System Error:'(E01),
lo_root->textid.
RETURN.
ENDTRY.
COMMIT WORK.
<b>Note:</b> 1. CL_DATA_OUT is the message interface class.
2. ls_output is the output structure to be sent back to XI and data
is an internal table with the same structure as tbl_data.
3. It is very imp to catch exceptions as i have shown u above.
Please let me know if you are a little clear or you need some more clarifications on this.
cheers
shivika -
File to R/3 via Abap proxy -- need help
Hello,
I have made a scenario File to R/3 via Abap Proxy
My Inbound Async Message Interface has Message Type -Emp_Rac_Detail_MT.
Message Type has structure
EmpID
EmpName
Age
I have table in R/3 ZRACTABLE where I need to post data
Fields in ZRACTABLE are
EMPID
EMPNAME
AGE1
Pls send me the code that I need to write in Async Method of Proxy
that will put data
RegardsHi Herry,
First of all u have to write a Function module in R/3 ....for that i given u the code above.
Now in ur inbount proxy in the implementation class u have to write code right???
Here is the code...
**** INSERT IMPLEMENTATION HERE **** ***
DATA:
lv_EMPID type EMPID,
lv_EMPNAME type EMPNAME,
lv_AGE type AGE.
Convert Input Parameters
lv_EMPID = input-Emp_Rac_Detail_MT-EMPID.
lv_EMPNAME = input-Emp_Rac_Detail_MT-EMPNAME.
lv_AGE = input-Emp_Rac_Detail_MT-AGE.
call function 'ZEMP_RAC_FM' /** thats ur function module name **/
EXPORTING
EMPID = lv_EMPID .
EMPNAME = lv_EMPNAME.
AGE = lv_AGE.
endmethod.
Regards
biplab
<i>*** give points if it hepls you!!!</i> -
Can any one tell me how to handle interfaces in ABAP.
i would like to know what r all methodology or technology we can use like RFC,IDOC,BAPI,ALE,BDC.
Thanks in advanceHI ,
<b>BATCH DATA COMMUNICATION</b>
About Data Transfer In R/3 System
When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
In the process of replacing current applications and transferring application data, two situations might occur:
The first is when application data to be replaced is transferred at once, and only once.
The second situation is to transfer data periodically from external systems to SAP and vice versa.
There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called batch input or batch data communication.
1. SESSION METHOD
2. CALL TRANSACTION
3. DIRECT INPUT
Advantages offered by BATCH INPUT method:
1. Can process large data volumes in batch.
2. Can be planned and submitted in the background.
3. No manual interaction is required when data is transferred.
4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.
To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a data transfer program must map the data from the external system into the data structure required by the SAP batch input program.
The batch input program must build all of the input to execute the SAP transaction.
Two main steps are required:
To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.
To pass the table to SAP for processing.
Prerequisite for Data Transfer Program
Writing a Data Transfer Program involves following prerequisites:
Analyzing data from local file
Analyzing transaction
Analyzing transaction involves following steps:
The transaction code, if you do not already know it.
Which fields require input i.e., mandatory.
Which fields can you allow to default to standard values.
The names, types, and lengths of the fields that are used by a transaction.
Screen number and Name of module pool program behind a particular transaction.
To analyze a transaction::
Start the transaction by menu or by entering the transaction code in the command box.
(You can determine the transaction name by choosing System Status.)
Step through the transaction, entering the data will be required for processing your batch input data.
On each screen, note the program name and screen (dynpro) number.
(dynpro = dyn + pro. Dyn = screen, pro = number)
Display these by choosing System Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
The technical info pop-up shows not only the field information but also the program and screen.
For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
Note the following information:
- The field name for batch input, which youll find in its own box.
- The length and data type of the field. You can display this information by double clicking on the Data Element field.
Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.
Once you have program name, screen number, field name (screen field name), you can start writing.
DATA TRANSFER program.
Declaring internal table
First Integral Table similar to structure like local file.
Declaring internal table like BDCDATA
The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
Create a BDCDATA structure
Write the structure out to a session or process it with CALL TRANSACTION USING; and then
Create a BDCDATA structure for the next transaction that is to be processed.
Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
Data that is entered into screen fields.
Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
The BDCDATA structure contains the following fields:
PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
DYNPRO: Screen Number. Set this field only in the first record for the screen.
DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to (blank) for all other records.)
FNAM: Field Name. The FNAM field is not case-sensitive.
FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
Transferring data from local file to internal table
Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
Population of BDCDATA
For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
All these five initial steps are necessary for any type of BDC interface.
DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
<b>SESSION METHOD</b>
About Session method
In this method you transfer data from internal table to database table through sessions.
In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
Unless session is processed, the data is not transferred to database table.
<b>BDC_OPEN_GROUP</b>
You create the session through program by BDC_OPEN_GROUP function.
Parameters to this function are:
User Name: User name
Group: Name of the session
Lock Date: The date on which you want to process the session.
Keep: This parameter is passed as X when you want to retain session after
processing it or to delete it after processing.
<b>BDC_INSERT</b>
This function creates the session & data is transferred to Session.
Parameters to this function are:
Tcode: Transaction Name
Dynprotab: BDC Data
<b>BDC_CLOSE_GROUP</b>
This function closes the BDC Group. No Parameters.
Some additional information for session processing
When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
<b>CALL TRANSACTION</b>
About CALL TRANSACTION
A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program by
Call transaction <tcode> using <BDCTAB>
Mode <A/N/E>
Update <S/A>
Messages into <MSGTAB>.
Parameter 1 is transaction code.
Parameter 2 is name of BDCTAB table.
Parameter 3 here you are specifying mode in which you execute transaction
A is all screen mode. All the screen of transaction are displayed.
N is no screen mode. No screen is displayed when you execute the transaction.
E is error screen. Only those screens are displayed wherein you have error record.
Parameter 4 here you are specifying update type by which database table is updated.
S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.
A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).
Parameter 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:
1. Tcode: Transaction code
2. Dyname: Batch point module name
3. Dynumb: Batch input Dyn number
4. Msgtyp: Batch input message type (A/E/W/I/S)
5. Msgspra: Batch input Lang, id of message
6. Msgid: Message id
7. MsgvN: Message variables (N = 1 - 4)
For each entry, which is updated in database, table message is available in BDCMSGCOLL. As BDCMSGCOLL is structure, you need to declare a internal table which can contain multiple records (unlike structure).
Steps for CALL TRANSACTION method
1. Internal table for the data (structure similar to your local file)
2. BDCTAB like BDCDATA
3. UPLOAD or WS_UPLOAD function to upload the data from local file to itab. (Considering file is local file)
4. Loop at itab.
Populate BDCTAB table.
Call transaction <tcode> using <BDCTAB>
Mode <A/N/E>
Update <S/A>.
Refresh BDCTAB.
Endloop.
(To populate BDCTAB, You need to transfer each and every field)
The major differences between Session method and Call transaction are as follows:
SESSION METHOD CALL TRANSACTION
1. Data is not updated in database table unless Session is processed. Immediate updation in database table.
2. No sy-subrc is returned. Sy-subrc is returned.
3. Error log is created for error records. Errors need to be handled explicitly
4. Updation in database table is always synchronous Updation in database table can be synchronous Or Asynchronous.
Error Handling in CALL TRANSACTION
When Session Method updates the records in database table, error records are stored in the log file. In Call transaction there is no such log file available and error record is lost unless handled. Usually you need to give report of all the error records i.e., records which are not inserted or updated in the database table. This can be done by the following method:
Steps for the error handling in CALL TRANSACTION
1. Internal table for the data (structure similar to your local file)
2. BDCTAB like BDCDATA
3. Internal table BDCMSG like BDCMSGCOLL
4. Internal table similar to Ist internal table
(Third and fourth steps are for error handling)
5. UPLOAD or WS_UPLOAD function to upload the data from the local file to itab. (Considering file is local file)
6. Loop at itab.
Populate BDCTAB table.
Call transaction <tr.code> using <Bdctab>
Mode <A/N/E>
Update <S/A>
Messages <BDCMSG>.
Perform check.
Refresh BDCTAB.
Endloop.
7 Form check.
IF sy-subrc <> 0. (Call transaction returns the sy-subrc if updating is not successful).
Call function Format_message.
(This function is called to store the message given by system and to display it along with record)
Append itab2.
Display the record and message.
Check these links to know more
<b>BAPI</b>
http://www.allsaplinks.com/bapi.html
<b>IDOC</b>
http://www.allsaplinks.com/idoc_sample.html
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sappoint.com/abap.html
Regards,
Santosh -
Problem sending xls file in an attachment via ABAP proxy
Hello,
I have in tmp directory a xls file, I tranfer such file to a table, and afterwards I send in an attachment via ABAP proxy, here is the code:
l_attachment TYPE REF TO if_ai_attachment,
lt_attach TYPE prx_attach,
l_name TYPE string,
lx_string TYPE xstring,
l_string TYPE string,
l_type TYPE string,
des TYPE string.
CLASS cl_ai_factory DEFINITION LOAD.
DATA: BEGIN OF itab OCCURS 0,
raw(255) TYPE x,
END OF itab.
DATA: l_controller TYPE REF TO if_ai_posting_controller.
DATA: it TYPE zhcm_mt_segur_out.
CREATE OBJECT prxy.
OPEN DATASET orig FOR INPUT IN binary MODE.
READ DATASET orig INTO itab-raw.
WHILE sy-subrc = 0.
APPEND itab.
READ DATASET orig INTO itab-raw.
ENDWHILE.
CLOSE DATASET orig.
LOOP AT itab.
CONCATENATE lx_string itab-raw INTO lx_string in byte mode.
ENDLOOP.
L_NAME = 'Segur.xls'.
L_TYPE = CL_AI_ATTACHMENT=>IF_AI_ATTACHMENT~C_MIMETYPE_EXCEL.
TRY.
L_ATTACHMENT =
CL_AI_FACTORY=>CREATE_ATTACHMENT_FROM_binary(
P_DATA = LX_STRING
P_TYPE = L_TYPE
P_NAME = L_NAME ).
APPEND L_ATTACHMENT TO LT_ATTACH.
L_CONTROLLER = CL_AI_FACTORY=>CREATE_CONTROLLER( ).
L_CONTROLLER->SET_ATTACHMENTS( LT_ATTACH ).
CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
EXPORTING
CONTROLLER = L_CONTROLLER
OUTPUT = IT.
COMMIT WORK.
CATCH CX_AI_SYSTEM_FAULT .
DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
CREATE OBJECT FAULT.
WRITE :/ FAULT->ERRORTEXT.
ENDTRY.
I am using a Mail receiver channel, I receive a mail, with to attachments, one .xml and the other one .bin, I save it to my computer and I change the extension to .xls and when I try to open it, the file is not valid and can be opened after being repaired. What Im doing wrong? I would like to receive a valid xls file, what i should change?
Thanks a lot,
LuisHi,
yes I know, I have used the MessageTransformBean module, and the PayloadSwapBean module. But which parameter I should use for leaving only one attachement in the e-mail. I did this configuration:
1
localejbs/AF_Modules/MessageTransformBean
Local Enterprise Bean
<b>trans</b>
2
localejbs/AF_Modules/PayloadSwapBean
Local Enterprise Bean
<b>swap</b>
3
localejbs/AF_Modules/MessageTransformBean
Local Enterprise Bean
<b>trans1</b>
4
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
Local Enterprise Bean
mail
<i><b>Module configuration</b></i>
trans
Transform.ContentDisposition
inline
swap
swap.keyName
payload-name
swap
swap.keyValue
Segur
trans1
Transform.ContentDescription
Segur
trans1
Transform.ContentDisposition
attachment;filename="Segur.xls"
trans1
Transform.ContentType
application/vnd.ms-excel;name="Segur.xls"
In the e-mail I get one attachement without name .xml and another one Segur.xsl, and I want only one attachment, the last one. What I should change in my configuration??
Best regards,
Luis -
hi ppl,
Can anybody give me information on what is and how to create
container creation,methods,class,interface....with programs.>
priyank dev wrote:
> hi ppl,
> Can anybody give me information on what is and how to create
> container creation,methods,class,interface....with programs.
Hi Dev,
Interface is just the skeleton of the class definition.
If you want to have your own code for all or any of the methods that interface is havings then you can create an instance of that interface and implement those methods with you own code.
That is the advantage of object oriented programming. And if you want to use the standard method or original method's functionality then you have call the method along with the class which implemented it like below
class => method1
For Imore information on interfaces Check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
For creating classes you can follow this procedure.
Go with abap dictionary->select database table->provide the table for dev classs eg. V_TDEVC-> go for display option-> select utilities->select contents option-> select create dev class,
provide the name and short text,software component->create req.no.
with this dev class will be created.
Thanks
Nitesh
Edited by: Nitesh Kumar on Nov 18, 2008 10:56 AM -
Names of interface tables and interface programs of oracle modules
Hi all,
i need urgent and accurate information about the names of interface tables and interface programs of the following oracle modules,R12, or either ther are custom made. Any accurate link refering to the desire information would be much appreciated.
Plus i need a clear and simple definition and purpose of interface tables and interface program and by what other names are they known in industry.
Data Object,Oracle Module
Chart of Accounts,Oracle General Ledger
Trial Balance,Oracle General Ledger
Supplier Master,Oracle Payables
Open Supplier Invoices,Oracle Payables
Open Supplier Credit/ Debit Memos,Oracle Payables
Open Supplier Advances,Oracle Payables
Bank Master,Oracle Cash Management
Customer Master,Oracle Receivable
Asset Categories,Oracle Assets
Asset Master,Oracle Assets
Item Master,Oracle Inventory
Item Categories,Oracle Inventory
Sub Inventory and Locators,Oracle Inventory
Item On Hand Balances,Oracle Inventory
Item wise Per unit Cost,Oracle Inventory
Bill of Material,Oracle Discrete Manufacturing
Departments,Oracle Discrete Manufacturing
Operations,Oracle Discrete Manufacturing
Routings,Oracle Discrete Manufacturing
Resources,Oracle Discrete Manufacturing
Overheads,Oracle Discrete Manufacturing
Employee Master,Approval Hierarchy
Approval Hierarchy,Approval Hierarchy
Open Customer Invoices,Oracle Receivables
Open Customer Credit/ Debit Memos,Oracle Receivables
Open Customer Advances,Oracle Receivables
Pending Requisitions,Oracle Purchasing
Pending Purchase Orders,Oracle Purchasing
Open Sales Orders,Oracle Order Management
Price List,Oracle Order ManagementHi;
Its metalink note you need to login metalink wiht valid CSI(customer Support Identifier) number to can se note via using note number.
Please see:
Oracle EBS Based and Interface tables
Oracle EBS Based and Interface tables
Regard
Helios -
Error while transporting class interface
hi,
i have developed class interfaces where i'm using a z-structure(eg ZBMTBATCH) for type definition in public section.
The interface is activated and is working fine is development server.
when i transported it in quality, the transport req failed showing error " ZBMTBATCH not found".
This structure is a trans table and is activated.
Same type of error occured in transport req of all other class interface . only difference is the structure.
The class interface throwing this error has one common similarity, the error it is throwing is for the first declaration.
i mean in public section if declaration is of type :
tbatch type ZBMTBATCH
than in transport log its throwing error as "ZBMTBATCH not found"
please suggest some reasonsHello,
Are u transporting the Structure also together with the Class.
If not first add the Structure to a TR and move it to Quality system. Then Re transport the TR with Classes.
Hope this will helps you.
Regards,
Vasanth -
Trigerring Outbound XI interfaces in ABAP
Hi,
I need to know about calling an outbound XI interface in ABAP. Can any body share some knowledge about this?
Thanks,
KulwantKulwant,
>>>While i m trying to edit EXECUTE_ASYNCHRONOUS method of my class, it says "You Cannot Edit Proxy Objects". Is it the expected behaviour or some thing is wrong at my side
Yes. It is the expected behaviour. You can not edit a client(outbound) proxy. You need to have a report which will call this method and pass the reqd data.
P.S For server proxy, you can and need to edit the EXECUTE_ASYNCHRONOUS. Here you will write the code to retrive the data and process.
>>>In SXMB_MONI, i can see Sender Message but will there be any response message too? Because i cannot find such message
Since your interface is asynchronous, you will not have a respose msg.
Regards,
Jai Shankar. -
Class, interface, or enum expected error
import java.awt.Graphics;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class InventoryFinal
//main method begins execution of java application
public static void main(final String args[])
int i; // varialbe for looping
double total = 0; // variable for total inventory
final int dispProd = 0; // variable for actionEvents
// Instantiate a product object
final ProductAdd[] nwProduct = new ProductAdd[5];
// Instantiate objects for the array
for (i=0; i<5; i++)
nwProduct[0] = new ProductAdd("CD", 10, 18, 12.00, "Jewel Case");
nwProduct[1] = new ProductAdd("Blue Ray", 9, 20, 25.00, "HD");
nwProduct[2] = new ProductAdd("Game", 8, 30, 40.00, "Game Case");
nwProduct[3] = new ProductAdd("iPod", 7, 40, 50.00, "Box");
nwProduct[4] = new ProductAdd("DVD", 6, 15, 15.00, "DVD Case");
for (i=0; i<5; i++)
total += nwProduct.length; // calculate total inventory cost
final JButton firstBtn = new JButton("First"); // first button
final JButton prevBtn = new JButton("Previous"); // previous button
final JButton nextBtn = new JButton("Next"); // next button
final JButton lastBtn = new JButton("Last"); // last button
final JButton AddBtn = new JButton("Add"); // Add button
final JButton DeleteBtn = new JButton("Delete"); // Delete button
final JButton ModifyBtn = new JButton("Modify"); // Modify button
final JButton SaveBtn = new JButton("Save"); // Save button
final JButton SearchBtn = new JButton("Search"); // Search button
final JLabel label; // logo
final JTextArea textArea; // text area for product list
final JPanel buttonJPanel; // panel to hold buttons
//JLabel constructor for logo
Icon logo = new ImageIcon("C:/logo.jpg"); // load logo
label = new JLabel(logo); // create logo label
label.setToolTipText("Company Logo"); // create tooltip
buttonJPanel = new MyJPanel(); // set up panel
buttonJPanel.setLayout( new GridLayout(1, 4)); //set layout
// add buttons to buttonPanel
buttonJPanel.add(firstBtn);
buttonJPanel.add(prevBtn);
buttonJPanel.add(nextBtn);
buttonJPanel.add(lastBtn);
buttonJPanel.add(AddBtn);
buttonJPanel.add(DeleteBtn);
buttonJPanel.add(ModifyBtn);
buttonJPanel.add(SaveBtn);
buttonJPanel.add(SearchBtn);
textArea = new JTextArea(nwProduct[3]+"\n"); // create textArea for product display
// add total inventory value to GUI
textArea.append("/nTotal value of Inventory "+new java.text.DecimalFormat("$0.00").format(total)+"\n\n");
textArea.setEditable(false); // make text uneditable in main display
JFrame invFrame = new JFrame(); // create JFrame container
invFrame.setLayout(new BorderLayout()); // set layout
invFrame.getContentPane().add(new JScrollPane(textArea), BorderLayout.CENTER); // add textArea to JFrame
invFrame.getContentPane().add(buttonJPanel, BorderLayout.SOUTH); // add buttons to JFrame
invFrame.getContentPane().add(label, BorderLayout.NORTH); // add logo to JFrame
invFrame.setTitle("CD & DVD Inventory"); // set JFrame title
invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // termination command
//invFrame.pack();
invFrame.setSize(600, 600); // set size of JPanel
invFrame.setLocationRelativeTo(null); // set screen location
invFrame.setVisible(true); // display window
// assign actionListener and actionEvent for each button
firstBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end firstBtn actionEvent
}); // end firstBtn actionListener
textArea.setText(nwProduct[4]+"n");
prevBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[4]+"\n");
} // end prevBtn actionEvent
}); // end prevBtn actionListener
textArea.setText(nwProduct[4]+"n");
nextBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[2]+"\n");
} // end nextBtn actionEvent
}); // end nextBtn actionListener
textArea.setText(nwProduct[4]+"n");
lastBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[3]+"\n");
} // end lastBtn actionEvent
}); // end lastBtn actionListener
textArea.setText(nwProduct[4]+"n");// assign actionListener and actionEvent for each button
AddBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end AddBtn actionEvent
}); // end AddBtn actionListener
textArea.setText(nwProduct[4]+"n");
// assign actionListener and actionEvent for each button
DeleteBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end DeleteBtn actionEvent
}); // end DeleteBtn actionListener
textArea.setText(nwProduct[4]+"n");
// assign actionListener and actionEvent for each button
ModifyBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end ModifyBtn actionEvent
}); // end ModifyBtn actionListener
textArea.setText(nwProduct[4]+"n");
// assign actionListener and actionEvent for each button
SaveBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end SaveBtn actionEvent
}); // end SaveBtn actionListener
textArea.setText(nwProduct[4]+"n");
// assign actionListener and actionEvent for each button
SearchBtn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
textArea.setText(nwProduct[0]+"\n");
} // end SearchBtn actionEvent
}); // end SearchBtn actionListener
textArea.setText(nwProduct[4]+"n");
// prevBtn.addActionListener(new ActionListener()
// public void actionPerformed(ActionEvent ae)
// dispProd = (nwProduct.length+dispProd-1) % nwProduct.length;
// textArea.setText(nwProduct.display(dispProd)+"\n");
// } // end prevBtn actionEvent
// }); // end prevBtn actionListener
} // end main
} // end class Inventory4
class Product
protected String prodName; // name of product
protected int itmNumber; // item number
protected int units; // number of units
protected double price; // price of each unit
protected double value; // value of total units
public Product(String name, int number, int unit, double each) // Constructor for class Product
prodName = name;
itmNumber = number;
units = unit;
price = each;
} // end constructor
public void setProdName(String name) // method to set product name
prodName = name;
public String getProdName() // method to get product name
return prodName;
public void setItmNumber(int number) // method to set item number
itmNumber = number;
public int getItmNumber() // method to get item number
return itmNumber;
public void setUnits(int unit) // method to set number of units
units = unit;
public int getUnits() // method to get number of units
return units;
public void setPrice(double each) // method to set price
price = each;
public double getPrice() // method to get price
return price;
public double calcValue() // method to set value
return units * price;
} // end class Product
class ProductAdd extends Product
private String feature; // variable for added feature
public ProductAdd(String name, int number, int unit, double each, String addFeat)
// call to superclass Product constructor
super(name, number, unit, each);
feature = addFeat;
}// end constructor
public void setFeature(String addFeat) // method to set added feature
feature = addFeat;
public String getFeature() // method to get added feature
return feature;
public double calcValueRstk() // method to set value and add restock fee
return units * price * 0.10;
public String toString()
return String.format("Product: %s\nItem Number: %d\nIn Stock: %d\nPrice: $%.2f\nType: %s\nTotal Value of Stock: $%.2f\nRestock Cost: $%.2f\n\n",
getProdName(), getItmNumber(), getUnits(), getPrice(), getFeature(), calcValue(), calcValueRstk());
} // end class ProductAdd
class MyJPanel extends JPanel
//private static Random generator = new Random();
private ImageIcon picture; //image to be displayed
// load image
public MyJPanel()
picture = new ImageIcon("mypicture.png"); // set icon
} // end MyJPanel constructor
// display imageIcon on panel
public void paintComponent( Graphics g )
super.paintComponent( g );
picture.paintIcon( this, g, 0, 0 ); // display icon
} // end method paintComponent
// return image dimensions
//public Dimension getPreferredSize()
// return new Dimension ( picture.getIconWidth(),
//picture.getIconHeight() );
} // end method getPreferredSize
} // end class MyJPanel
import java.io.File;
import java.io.IOException;
public class FileAccessDemo
public static void main( String[] args ) throws IOException
// declare variables
String formatStr = "%s exists in %s? %b\n\n";
// processing and output
File file1 = new File( "studentScores.txt" ); // create a File object
System.out.printf
(formatStr, file1.getName(), file1.getAbsolutePath(), file1.exists());
// processing and output
File folder1 = new File( "c:/personnel/" ); // create a File object
folder1.mkdir(); // make a directory
File file2 = new File( "/personnel/faculty.txt" );
file2.createNewFile(); // create a new file
System.out.printf
( formatStr, file2.getName(), file2.getAbsolutePath(), file2.exists() );
// processing and output
file2.delete(); // delete a file, but not the directory
System.out.printf
( formatStr, file2.getName(), file2.getAbsolutePath(), file2.exists() );
} // end main
} // end class
I need help in resolving this error.
ThanksThat code isn't where your error is. Here's the errors I get compiling your code:
H:\java>javac InventoryFinal.java
InventoryFinal.java:78: ')' expected
textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n
^
InventoryFinal.java:78: ';' expected
textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n
^
InventoryFinal.java:340: class, interface, or enum expected
import java.io.File;
^
InventoryFinal.java:341: class, interface, or enum expected
import java.io.IOException;
^
4 errorsThe last two errors are on your import statements, which can't be in the middle of a source file. The first two are on this line:
textArea.append("/nTotal value of Inventory "new java.text.DecimalFormat("$0.00").format(total)"\n\n");Which certainly isn't a legal line of Java code. If you want to connect multiple Strings you need to use the "+" operator. -
Delete Overlapping Requests - by Filename via ABAP Routine
Hi SDN Community
Do you know if it is possible to set the delete overlapping request parameters to recoginse the file name, and remove it via the derivation of the file name via an ABAP Routine.
I am using an ABAP routine to derive the flat flat file upon loading, but do not know the syntax, or if it is possible to set this equivalent code into the delete overlapping request Routine area
(The code basically derives the first day of the calendar week, for previous weeks in the Do n times Loop
Thank you.
Simon
DATA: ld_CWEEK TYPE scal-week,
ld_DATE TYPE SY-DATUM,
ld_DATE1 TYPE SY-DATUM,
lc_DIRECTORY(30) TYPE c,
ln_YYYY(4) TYPE n,
ln_WW(2) TYPE n.
*Derive week from sy-datum
ld_date = SY-DATUM.
Determine the calendar week from the entered calendar date
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = ld_date
IMPORTING
week = ld_cweek
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
Get the First day of the week
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = ld_CWEEK
IMPORTING
date = ld_DATE1
EXCEPTIONS
week_invalid = 1
OTHERS = 2.
Need to find the previous calendar week and reconvert to the first
day in order to accomodate weeks less than 7 days
Get the last day of the current calendar week - 2
DO 2 TIMES.
ld_DATE1 = ld_DATE1 - 1.
Determine the calendar week from the last day of the previous week
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = ld_DATE1
IMPORTING
week = ld_CWEEK
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
Get the First day of the week
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = ld_CWEEK
IMPORTING
date = ld_DATE1
EXCEPTIONS
week_invalid = 1
OTHERS = 2.
ENDDO.
*ln_YYYY = ld_CWEEK(4).
ln_YYYY = ld_DATE1(4).
ln_WW = ld_CWEEK+4(2).
*DIRECTORY represnts path where file is stored .
lc_DIRECTORY = '/interfaces/EDW/data/CSM/'.
CONCATENATE lc_DIRECTORY
ld_date '_WEEK' ln_WW '_c1_pri_' ln_YYYY '.csv' into p_filename.
'MIC_NT_' ld_date1 '_' ln_YYYY '.csv' into p_filename.Thank you for your response Debanshu
However, i could not find this process type in the process chain area.
Is this where you meant, can you please give me more detailed steps including long syntax of names of process types
We are on BW 3.50
i assumed the filename had to be constructed via abap according to some of the sdn replies i've searched through.
Thank you.
Simon
Maybe you are looking for
-
I'm using a 64 GB iPhone 6 running iOS 8.2 and starting last week the Health app has gone completely off the rails. I average somewhere between 6 and 7,000 steps a day (trying to work my way past 10k) but noticed 5 days ago it now shows me walking 30
-
I need to change Font of SQL*PLUS 3.3 to courier new and font size 8.. do you have any idea how can I achive this.. I tried changing registry also but it doesnot work. I am using Windows 95 machine. My database is Oracle 8i. Please help me if you kno
-
I am getting this exception when I'm adding a Sales Order with the DI API: Method not found: 'SAPbobsCOM.Document_SpecialLines SAPbobsCOM.IDocuments.get_SpecialLines()' I am not using this interface in any of my code so I'm not understanding from whe
-
OS 9 on 10.4.11?
Greetings, I have a powerbook G4 which is new to me... It came newly formatted an re-loaded with 10.4.2 from the system discs... I then updated to 10.4.11 from the Apple download site.. I now want to install OS 9 so that I can have access to Classic.
-
Siring - simple question of a newbie
I am a jsp newbie. I try a little code as follows: <% String a1="welcome to"; String a2="\n"; String a3="this test"; String a=a1+a2+a3;%> <br> Print out result a= <%=a%>; Then it prints a=welcome to this test. I want to see like this: welcome to this