Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all 10425 articles
Browse latest View live

Consume a web services in abap program

$
0
0

Hi all,

 

I saw different posts about this subject, but I don't get the solution.

I have a web services that i need consume in abap program. i made the following steps:

 

- In the se38 I create a client proxy

- In the soaManager I create a Logical Port.

- I create a program to execute the client proxy.

 

When I execute the program occur the following error:

 

"System fault occurred: SOAP:1.001 CX_SXML_PARSE_ERROR:SXML reader/writer exception.Error while parsing an XML stream: 'undeclared namespace prefix'."

 

The error occur in the code where I unparserd fragment. 

 

*create SXMLP fragment.

  l_fragment = cl_sxmlp_factory=>create_fragment(

                                        name  = m_wrapped_part->qname-na

                                        nsuri = m_wrapped_part->qname-na

  l_fragment->set_unparsed_fragment( fragment = l_xstring ).

  l_fragment->serialize( writer = writer package_writer = package_writer

 

 

Follow the program code:

 

REPORT  z_execute_ws.

 

DATA: lo_sys_exception      TYPE REF TO cx_ai_system_fault.

DATA: zproxy                TYPE REF TO zproxyco_hpd_incident_interfac.

DATA: lo_app_ex             TYPE REF TO cx_ai_application_fault.

DATA: ws_header             TYPE REF TO if_wsprotocol_ws_header.

 

 

DATA: ixml                TYPE REF TO if_ixml,

       xml_document        TYPE REF TO if_ixml_document,

       xml_root            TYPE REF TO if_ixml_element,

       xml_element         TYPE REF TO if_ixml_element,

       xml_node            TYPE REF TO if_ixml_node,

       name                TYPE string,

       namespace           TYPE string..

 

DATA l_xstring        TYPE xstring.

DATA l_string         TYPE string.

FIELD-SYMBOLS         <fs_xstring> TYPE xstring.

 

    CONCATENATE

     '<soapenv:Header>'

     '<urn:AuthenticationInfo>'

     '<urn:userName>_Service_SBM</urn:userName>'

     '<urn:password>123456</urn:password>'

     '</urn:AuthenticationInfo>'

     '</soapenv:Header>' INTO l_string.

 

 

TRY.

    CREATE OBJECT zproxy

       EXPORTING

         logical_port_name = 'Z_LP_CO_HPD_INCIDENT_INTERFAC'.

 

    ws_header ?= zproxy->get_protocol('IF_WSPROTOCOL_WS_HEADER').

 

   l_xstring = cl_proxy_service=>cstring2xstring( l_string ).

 

     IF NOT l_string IS INITIAL.

 

       CALL FUNCTION 'SDIXML_XML_TO_DOM'

         EXPORTING

           xml           = l_xstring

         IMPORTING

           document      = xml_document

         EXCEPTIONS

           invalid_input = 1

           OTHERS        = 2.

 

       IF sy-subrc = 0 AND NOT xml_document IS INITIAL.

         xml_root = xml_document->get_root_element( ).

         xml_element ?= xml_root->get_first_child( ).

 

 

         WHILE NOT xml_element IS INITIAL.

           name = xml_element->get_name( ).

           namespace = xml_element->GET_NAMESPACE_uri( ).

 

           ws_header->set_request_header(

                       name = name

                       namespace = 'urn:HPD_IncidentInterface_WS'

                       dom = xml_element ).

 

           xml_element ?= xml_element->get_next( ).

         ENDWHILE.

       ENDIF.

     ENDIF.

 

 

   CATCH cx_ai_system_fault .

ENDTRY.

DATA: output  TYPE  zproxyhelp_desk_query_service .

DATA: input TYPE  zproxyhelp_desk_query_service1 .

 

 

TRY.

     input-parameters-incident_number = 'INC000000000668'.

 

 

     CALL METHOD zproxy->help_desk_query_service

       EXPORTING

         input  = input

       IMPORTING

         output = output.

 

 

   CATCH cx_ai_system_fault INTO lo_sys_exception.

     WRITE:/ 'System fault occurred:', lo_sys_exception->code, lo_sys_exception->errortext.

   CATCH cx_ai_application_fault INTO lo_app_ex.

     WRITE: / 'Application fault occurred ', lo_app_ex->textid.

ENDTRY.

 

Can somebody help please ?

 

Thanks in advance,

 

Best regards,

 

 

 



Re: Code Scanner for Implicit Enhancements

$
0
0

For those of you that have been waiting with baited breath for an answer here (ha!):

 

I'm still working on web dynpro enhancements, but for report/FM/class based enhancements, you can find what you need in table:

 

ENHINCINX

 

Field ENHINCLUDE has an include name that can be read at runtime using the READ REPORT command.

 

I'll update again if I can find web dynpro enhancements.

Re: Attach multiple files in GOS

$
0
0

@David Who is talking about Batch Input??

Attach multiple files in GOS

$
0
0

@Poul It´s the GOS class: CL_GOS_MANAGER

Re: abap program to create tables from spread sheet

$
0
0

Thanks Sahoo, for your inputs, I was wondering if we have any method given by sap throw LSMW or any BDC program or utility given by SAP to make it simpler.

 

I cannot spend more time to do some research with FM and creating program... now..

 

 

 

 

Thanks,

Mahesh

Re: USING FIELD (DATE AND TIME) IN ZTABLE

$
0
0

Naveena,

 

Thanks for your quick reply. I also used data type TZNTSTMPS.

Here is what is happening I am taking yymmdd mm:ss moving into variable whose data type is TZNTSTMPS. When I take this value and write to ZTABLE field input_datetime its showing 20,130,319,184,844. If you look at TZNTSTMPS formatting data type shows DEC 15.

 

Any suggestions. I am sure it's something simple which I didn't notice.

 

Thanks,

 

james

Re: user exit message only once

$
0
0

Yep, I guess my approach was not the best one, sorry for that...

Did a quick checking in system I have and saw same kind of development there but, indeed, was not the best way to do it.

Hendrik's approach is better.

 

Regards,

Edgar

Re: GETWA_NOT_ASSIGNED

$
0
0

I have encountered the same program now. Curious about the cause.


Re: SAP PS BADIs - dump

$
0
0

Hi Alexandre,

 

Have you checked if previous step 5 (BAPI_BUS2002_ACT_CREATE_MULTI) returned any error?

 

Edgar

Re: SAP PS BADIs - dump

$
0
0

Hi Alexandre,

 

yes, you have to commit before attach new wbs or networks.

 

I´ve already done something like this, using this order:

 

BAPI_PROJECTDEF_CREATE

COMMIT WORK AND WAIT

BAPI_PROJECT_MAINTAIN (creating many WBS elements, and using SaveAndWait)

BAPI_PROJECT_MAINTAIN (creating many Networks, and using SaveAndWait)

BAPI_PROJECT_MAINTAIN (creating many Networks Activities, and using SaveAndWait)

BAPI_PROJECT_MAINTAIN (creating many Activity Milestones, and using SaveAndWait)

 

This works perfectly fine for me in the same routine, but one after the other commit.

 

Regards,

Frisoni

Re: Send PDF formular by email (EFG_PRINT)

$
0
0

I finally solve it by printing in a local printer, reading the spool and using the pdf from the spool to generate my own emails.

 

thanks anyway for the help.

Re: Regarding Toolbar shortcuts in SET_TABLE_FOR_FIRST_DISPLAY

$
0
0

Hi Pavan,

 

I have the same requirement. How did you assign ctrl-f function to the search button in the toolbar?

 

Thanks in advance.

 

Jennie

BAPI error: X is not allowed for LOGIC_SWITCH-PRICING

$
0
0

Hi,

 

   BAPI 'BAPI_SALESORDER_CHANGE' is giving an error when trying to 're-determine the sales order item price' by passing 'logic_switch-pricing = 'X''. After gone though different OSS notes '574088, 593246, 449068, 403065, 410907 and 375016', found that it works for only B / C / G / space pricing types. Found that its working fine using VA05 and /AFS/MDC tcodes.

 

   Could any one know how to re-determine sales order price for pricing type X. any other options.

 

Thanks inadvance,

Satya

Re: WA08 Warehouse Orders

Re: LOIPRO triggered twice on COR2 save

$
0
0

Tabraiz,

 

what solution you used finally ?

is it triggering two idocs or 1 idoc ?

 

did you use BADI : WORKORDER_UPDATE and submitting program:  RCCLORD to trigger outbound idoc LOIPRO ?

 

 

Appreciate your earliest reply.

 

 

Thanks,

Mahesh


what table to find for relation between recording types?

$
0
0

Hi all,

 

I have a set of inspection lot numbers.I would like to know how inspection lot is linked to the recordin type of QM subsystem(link).Is there any table or Function modules maintained to get the information.

 

I have different RUECKMELNR(Confirmation number for inspection characteristic) i want to get the SATZART(Record type) associated with it??

 

reference link

 

Thanks all

Bapi to add new inspection characteristic in QA02?

$
0
0

Hi all,

 

I am looking for Bapi to add new inspection characteristic as it is possible in QA02.I am able to change the existing inspection characteristics by using QIRF_GET_ALL_DATA_VALUES2 Fm now i want to add new inspection characteristic ??

 

 

Thanks all

Re: Regarding Toolbar shortcuts in SET_TABLE_FOR_FIRST_DISPLAY

$
0
0

Hello Pavan,

 

Handle it as an user command.Create an User command  for the search button (binoculars) in the standard toolbar section of your custom  status .

  Sometime back I had replied to  a requirement to implement the search functionality

by using custom code. You could then call this as needed from PAI. However there might be an issue , when multiple grids are displayed on one screen, as you might not know for which grid you would want the help to get triggered for. I tried this and it is working fine for me.

http://scn.sap.com/thread/3278471

 

Hope this helps.

 

Thanks,

Venkat.

 

Message was edited by: Venkat Gowrishankar

Re: Regarding Toolbar shortcuts in SET_TABLE_FOR_FIRST_DISPLAY

$
0
0

Hello Pavan,

 

Follow Venkat's instructions, except where he has the syntax:

"ls_toolbar-function = 'SEARCH'"  change to "ls_toolbar-function = 'CTRL+F'".  

This will set E-UCOMM to 'CTRL+F'.

 

Also, you can add:  ls_toolbar-quickinfo = 'Search (CTRL+F)'. This will let the user know the control key command.

 

Regards,

Kim

Re: Sentence Try...Catch when submiting a report

$
0
0

Hello Marcelo,

 

Catching exceptions after 'SUBMIT AND RETURN' is a bit tricky because the calling program and the called program are in two different internal sessions.

 

Have you tried simply to check the SYST table (SY-MSGTY, SY-MSGNO, SY-MSGID, SY-MSGV1, etc.) upon returning back from the called program?

 

Regards,

Kim

Viewing all 10425 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>