File to Proxy Scenario using ABAP Class and DB Multi Connect
Hello Friends,
I have a scenario below and a proposed solution. I would like some input as to whether i am headed the right way.
Scenario: Thousands of records come in from the legacy accounting system. The fields of these records need to be mapped to SAP fields using cross-reference tables stored in DB2. Finally, summarize the records by deleting a few fields and feed to R/3.
Solution i proposed:
(1) File Adapter is used to send the file
(2) Although JDBC adapter comes first to mind but since i need to access the DB2 tables multiple times for each record i propose to use an ABAP class for the mapping. Within the ABAP class the intent is to open an database connection to DB2, read the relevant cross tables using native SQL and finally generate the output XML.
(3) Reciever is Proxy which feeds this generated XML to SAP for creating posting via BAPI_ACC_DOCUMENT_POST
Question: Is the above solution correct or is there a better method to implement this scenario?
Please let me know.
Thanks,
Minhaj.
Looks fine. Few observations -
1. Whether it is ABAP class or Mapping in RFC lookup, you are making multiple trips to the database.
2. It looks like PI is being used only for reading the file and converting it to XML.
3. If using PI is not mandatory, then a complete ABAP class on ECC it self would be faster than swtching between PI Java, PI ABAP then round trips to DB2 finally data push to ECC.
If you could look at something like fetching all the required RFC look up data in one go and then map the fields according, might save u on processor and network resources.
VJ
Similar Messages
-
ALV using ABAP Classes and Objects
Hi All,
I am trying to print the values in my internal table using ALV, using ABAP classes and objects. Here the title for columns are picked based on the title specified in the data element. I want to set the title of my columns by my own. how to achieve this ?. Please provide me a sample code if possible.
thanks & regards,
Navneeth.KHello Navneeth
The following sample report shows how to build and modify a fieldcatalog (routine <b>BUILD_FIELDCATALOG_KNB1</b>).
*& Report ZUS_SDN_ALVGRID_EVENTS
REPORT zus_sdn_alvgrid_events.
DATA:
gd_okcode TYPE ui_func,
gt_fcat TYPE lvc_t_fcat,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid1 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1.
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '2000' OBLIGATORY.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
* define local data
DATA:
ls_knb1 TYPE knb1,
ls_col_id TYPE lvc_s_col.
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CASE e_column_id-fieldname.
WHEN 'KUNNR'.
SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
WHEN 'ERNAM'.
* SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
* NOTE: no parameter id available, yet simply show the priciple
CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
WHEN OTHERS.
* do nothing
ENDCASE.
* Set active cell to field BUKRS otherwise the focus is still on
* field KUNNR which will always raise event HOTSPOT_CLICK
ls_col_id-fieldname = 'BUKRS'.
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
is_row_id = e_row_id
is_column_id = ls_col_id.
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = p_bukrs.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create ALV grid
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_docking
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid1.
* Build fieldcatalog and set hotspot for field KUNNR
PERFORM build_fieldcatalog_knb1.
* Display data
CALL METHOD go_grid1->set_table_for_first_display
CHANGING
it_outtab = gt_knb1
it_fieldcatalog = gt_fcat
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* ok-code field = GD_OKCODE
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_FIELDCATALOG_KNB1
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog_knb1 .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'KNB1'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_fcat INTO ls_fcat
WHERE ( fieldname = 'KUNNR' OR
fieldname = 'ERNAM' ).
ls_fcat-hotspot = abap_true.
ls_fcat-scrtext_s = '<short text>'. " short text of column
ls_fcat-scrtext_m = '<medium text>'. " medium text of column
ls_fcat-scrtext_l = '<long text>'. " longtext text of column
ls_fcat-tooltip = '...'. " ALV control: Tool tip for column header
ls_fcat-coltext = '...'. " ALV control: Column heading
MODIFY gt_fcat FROM ls_fcat.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG_KNB1
Regards
Uwe -
Error in FILE 2 Proxy Scenario
Hi All,
I am doing File to Proxy Scenario i am getting following error
Could any one provide the solution for this.
*<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>*
*- <!-- Call Inbound Proxy*
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIProxy</SAP:Category>
<SAP:Code area="ABAP">INTERFACE_REGISTRATION_ERROR</SAP:Code>
<SAP:P1>ifmmessif</SAP:P1>
<SAP:P2>MI_Emp_Sender</SAP:P2>
<SAP:P3>Namespace</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>No implementing class registered for the interface (ABAP interface, request message MI_Emp_Sender, request message, namespace )</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
Thanks in Advance
Mahesh
</SAP:Error>
Edited by: Mahesh Reddy on Jul 10, 2008 12:47 PMHi Mahesh,
1) Use SPROXY transaction.
Menu-> Proxy -> Activate All.
2) check in the interface determination if u are using correct
inbound interface.
3) If this if fine....try deleting all proxy objects of the interface
and create new.
Regards,
Praveen K -
Hi Experts,
I am working on File To Proxy Scenario. I am getting the below Error: The Messages in SXMB_MONI are going to AUtomatically Restart Status. I see some Queues with RETRY Status in SMQ2. When i am testing from SPROXY, the Table is Updated with the Corresponding Values. But when i place the file in the ftp folder then i am getting this error.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Call Adapter
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="INTERNAL">CLIENT_SEND_FAILED</SAP:Code>
<SAP:P1>500</SAP:P1>
<SAP:P2>Internal Server Error</SAP:P2>
<SAP:P3>(See attachment HTMLError for details)</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>Error while sending by HTTP (error code: 500, error text: Internal Server Error) (See attachment HTMLError for details)</SAP:Stack>
<SAP:Retry>A</SAP:Retry>
</SAP:Error>
Please check and do the needful .
Regards,
GIRIDHARHi Giridhar,
The problem is with connection. Please check the below discussion
HTTP returns status is 500(Internal Server Error)
Problem in ABAP proxy........ | SCN
regards,
Harish -
Customizing FD01 and FB70 using PS Class and Characteristics
Hello SAP Experts
I have the following issue:
My client has a requirement where we need to customize the Customer Master (FD01) screen and the Invoice Posting Screen (FB70). A few additional fields have to be added by creating a separate tab. I was intending to take Abaper's help and do this using user exits but I have been suggested by the cleint to use SAP PS Class and Characteristics feature to do this. Can someone please throw some light on this feature and how can i create custom fields on FD01 and FB70 screens. Is there a way we could customize these screens using PS class and characteristics. Your opinions would be much appreciated.
Please kindly give your suggestions. Thanks in advance
Regards,
NikJoao Paulo,
Thank you for the response. I have tried to obtain some info from OSS but no luck. Tried all means but there is limited information available.
Nik -
File to SOAP Scenario Using BPM
Hi,
I am doing File to SOAP scenario using BPM.
while doing Integration Process in IR, i got the following error message
"Expression of simple type xsd:string expected"
But i have given xsd:string in the correlation element as well as in Data types.
I dont know why it is getting the error.
could you anyone please help me to sort out?
Regards,
Sai Ch.Hey,
Check in the correlation editor, where you define the condition.
Whether the data type of the XPath is string and whether it matches with the data type of the messages that you have selected.also make sure the type of the correlation variable is string.
regards,
Milan -
File to Proxy Scenario : Error in communication channel monitoring
Hi,
I have developed File to Proxy Scenario on PI 7.1 system and it is not working. I see the below error in communication channel monitoring.
u201CError: com.sap.engine.interfaces.messaging.api.exception.ConfigException: Some of the IS access information is not available. SLDAccess property may be set to true, but SLD is not available.u201D
File will be picked from the FTP server.
I have created File system in SLD of type "Third Party", Can this be the issue?
Please guide me on this.
Thanks,
ChandravadanHi!
Check if the tcode SLDCHECK is ok!
Check note #764176.
Also, refer to link below and execute each steps from the links there MANUALLY.
Wizard-Based Configuration:
http://help.sap.com/saphelp_nwpi71/helpdata/EN/45/2e4c1b16bb4aa8e10000000a11466f/frameset.htm
Regards,
Caio Cagnani -
How to use ABAP Class to modify Web Query Result ??
Hi all !
We are using Web Templates to display our Query.
What I would like to do ( and seems a really important issue for our users! ) is to have a "PAGE BREAK" everytime the value of a charateristics change in the report
For Example :
-Page 1-
Division Project
A 1
2
3
-Page 2-
Division Project
B 1
2
3
and so on....
I read threads about using ABAP CLASS but no example what so ever...
We are presently under BW 3.1 but are considering upgrading to 7.0 by the end of the year so if there is a solution to my problem on either version i'd like to know.
If anyone has any information about how I can do this it would be most appreciated
Thx
JB.Hi Yong,
Ravi is right, first check the blogs by Jocelyn, and if you still have specific questions you can ask them. I have used ABAP classes in workflow and I know Mike Pokraka tries to use classes exclusively.
Regards,
Martin -
Dear one,
I need a solution for my problem facing this moment.
Here is the File to proxy scenario explained.
I created three new fields in XI IR to map three more fields from File to CRM .On this line,I created three fields in IR and passed the updated file(containing three new filelds) and interfaced.Before that I had regenarated and activated CRM level proxy too.
The file was red by XI and moved to CRM also.
Now my problem is that I can see the three new fields in SXMB_MONI when I got into detail of that . But when I debug the CRM proxy the value for these three fields are not displaying over there .
These three values are displayed in XML message but not in proxy ,why it is so?.
Please help me out to resolve the issue.
Swasthi,
KarthikHi Manjusha,
Here is the reply:
Is the issue with the fields , or the values in the fields ?
Ans:Issue is with the values ,not with the fields .
Is it that your proxy structure doesn't have the fields ?
Ans:Proxy structure have the fields but not value.
Can you check sxmb_moni in the CRM system if these fields with value appears.
Ans:I checked in the CRM system
<TOTL_INFO>
<DT_INVOICE>
<MT_Invoice>
<ECOMM_VAT_BASIS_AMT>12</ECOMM_VAT_BASIS_AMT>
<ECOMM_VAT_AMT>13</ECOMM_VAT_AMT>
<ECOMM_CURR_CODE>GBP</ECOMM_CURR_CODE>
</TOTL_INFO>
</DT_INVOICE>
</MT_Invoice>
Both field and values are coming perfectly in XML message..
You can see that above in last three fields (Field- ECOMM_VAT_BASIS_AMT , Value-12 and etc.).
Only values are not coming in proxy structure(table) ....fields are coming with no values
Pls let us know yr views. -
Hi All,
I hav a file to proxy scenario. The XML file is sent as a proxy from XI to ECC. but ECC is receving it as a blank file.
SXMB_MONI in XI is success but in ECC it has failed. Please help us understand where the problem is occuring.
Regards,
Sudeep RHi,
Please check your sxmb_moni in ECC & XI, in both message, check the message data is same.
If you are receiving data on PI from file successfully, the problem can be in Mapping in PI, check that in PI. In this case data will not be sent to ECC System.
If you are receiving data on ECC from PI, now check the problem in Proxy code.
Check the steps for inbound proxy in the below blog :
/people/sandeep.kaushik/blog/2010/07/15/abap-proxy-complete-developments-on-sap-pi-sap-abap-systems -
File to Proxy scenario message failed in ECC with staus SYSFAIL
Hi All,
We are working on File to proxy scenario, PI able to send message successfully to ECC, but In ECC , message got stuck in queues with the status 'SYSFAIL',
when I read the error message it is showing Address Invalid.
when I run the LUW, it is giving 'Function module does not exist or EXCEPTION 'raised message.
I'm using PI 7.1 EHP1 , ECC 6.0, can anyone suggest the trouble shooting guidelines for this issue?
Thanks,
Venu.when I run the LUW, it is giving 'Function module does not exist or EXCEPTION 'raised message.
in your code, there seems to be an invalid statement.
check the proxy code. -
File to IDOC Scenario using BPM
Hi Experts,
I am working on file-Bapi-Idoc scenario using BPM.
I have two conditions
1. If the Sonumber is populated then need trigger an Bapi_change
2.If the Sonumber is not populated from the file then need to trigger a Bapi_Createfromdat to create the sales order and receive the salesorder number as response from Bapi
and the response of these BAPIs should be validated whether the Bapi is successful or not.
If it is successful message then need to trigger IDOC or else should throw an alert message.
let me know the steps involved in this scenario.
can i send alert message to other email IDs or can i send it to only XI admin?
Please let me know u r inputs.
Thanks in advance
PraveenHey,
You need to have a BPM for this.
BPM design.
Recieve step(abstract asynchronous) for file structure
Switch Case(condition whether sonumber is populated or not)
if populated
Branch 1(of switch)
transforamtion step:- mapping between File and Bapi_Change(Request structure)
Send step(abstract syncronous) To send the BAPI_change
Branch 2(of switch)
transformation step:-mapping between file and BApi_Create
Send step(abstract synchronous) To send the BAPI_Create
Block step(which will include the Switch step)
trigger an Execption in case of an error(in any of the two branches) through the block
The Exception will trigger an alert.
Now after the Block step there will be a transformation step(which will have the mapping between RFC response and Idoc)
Next is the send step(abstract asynchronous) for the idoc
In case if there is no exception the Idoc will be triggered or the exception branch will trigger the alert
rewards points if useful
regards,
Milan -
How to import .jar files in order to use the classes within this file
hello guys,
I'm just wondering how can i import .jar files in order to uses the classes within this file.
let's take an example:
i have a folder in which I have many .jar files which contain classes to be called. the full path of this folder is set in the Classpath inside the enviroment variables.
so does anyone have any idea how can i import these .jar files so i can use the classes?
thank you.Hi,
My problem is that: I created a Serializable class in a project. And I added this project (first project) to another project (second project). First project is appearing in the second project' s Libraries folder. No problem. I want to create a jar file from second project. i.e. I want to Build second project (I use NetBeans IDE). I am using Build Main Project tab under Run. It is falling out. I am finding it second project' s jar file under its folder. I am clicking on it. But it is NOT WORKING. Do you know WHY. Could you help me please?
Thanks, -
Calling a custom tcode using abap class from workflow
Hi Experts,
I have a requirement of calling a custom tcode from my workflow.
For this i have created a class zcl_test ( has if_workflow ) .
I created a method ztest which will call the tcode.
CALL TRANSACTION 'ZTX'. ( My tcode just has 1 input field, for testing purpose )
Then i created a task in whichi hv used this abap class and method.
But the tcode does not run when i execute the workflow.
Please help.
Thank You,
Radhika Vadher.Radhika Vadher
use the sample code to get the data from the task container into the ABAP class
DATA :
w_ref TYPE REF TO if_swf_run_wim_internal,
w_ref_cnt TYPE REF TO if_wapi_workitem_context,
w_wi_ref TYPE REF TO if_swf_ifs_parameter_container.
TRY.
CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
EXPORTING
im_wiid = w_wiid
RECEIVING
re_instance = w_ref.
CATCH cx_swf_run_wim_enq_failed .
CATCH cx_swf_run_wim_read_failed .
CATCH cx_swf_run_wim .
ENDTRY.
CALL METHOD w_ref->get_workitem_context
RECEIVING
re_ctx = w_ref_cnt.
CALL METHOD w_ref_cnt->get_wi_container
RECEIVING
re_container = w_wi_ref.
and the w_wi_ref is having a method GET use that method to get the values of the task container into the ABAP class. -
Function module equivalent to SWE_EVENT_CREATE while using ABAP classes
Hi there,
I used to use SWE_CREATE_EVENT to fire the events linked to my BOR objects, in order to start certain workflows.
Now I am using ABAP classes within the WorkFlows, and the name of the classes MUST (in my case) be longer than 10 characters, and SWE_EVENT_CREATE is cutting the name so it does not work
Do you know any FM equivalent to start an event from a ABAP class (SE24) object?
I have tried to use SAP_WAPI_START_WORKFLOW, but I cannot find the way to include my object in the container. Any ideas on this point would be welcome as well
Thanks so much,
MiguelThanks for such a quick reply,
You were right. I actually did follow Jocelyn's blogs, but somehow I skipped the raising event section.
Just for information, the URL with the solution to this problem is:
/people/jocelyn.dart/blog/2006/07/27/raising-abap-oo-events-for-workflow
Have a good one
Maybe you are looking for
-
What has APPLE done to iTunes 7.1 This is HORRIBLE
This new version has completly jumbled all of my TV shows and will not put them back in numerical or in episode order. What is the problem here, does Apple think people just want to watch any old thing that comes up next on the computer. Help ...plea
-
Error 400 in signing in to PSE9
I have Windows 7 and PSE9. I can sign in to my account with Photoshop.Com but not to my PSE9. I cannot sync files to Photoshop.Com or Revel. I can also not access the installed Photoessentials 3. I have checked my firewall and all seems to be okay to
-
hi, i have to design some data entry screens and update custom tables. what are the tips for screen design or the process flow ? any tip will be helpful.. thks
-
Where are stored electronical documents attached from PC
Hello, I'm working on the Archive link and attachment link to SAP object as outgoing invoice (VF02), incoming purchase order (ME22N). We have implemented a SAP content repository. I well understood when I attach a document with "Store business docume
-
Management of UCS-E SDRAM cards
It would be nice to find some documentation on the UCS-E series SD ram card that is provided as a blank for host OS. In particular it would be nice if the CIMC could be used to manage this card in a future firmware update. Functions should include, f