Problem while sending the o/p of payslip report through mail

Hi ,
         I am trying to mail the output of ZHINACALC0 (copy of standard program HINCALC0 for payslip display)
        In the report code of ZHINCALC0, there is a form named xform which contanis the o/p of the employee's payslip.
CALL FUNCTION 'HR_PL_APPEND_FORM'
           EXPORTING
                imp_pernr  = pernr-pernr
                imp_period = rgdir-inper                "XMS note 386560
           TABLES
                imp_form   = *xform*
           EXCEPTIONS
                OTHERS     = 0.
I am using the following function module to get the o/p from memory.
SUBMIT ZHINCALC0  EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
       TABLES
            LISTOBJECT = LISTOBJECT
       EXCEPTIONS
            NOT_FOUND  = 1
            OTHERS     = 2.
  IF SY-SUBRC <> 0.
  WRITE  'Error in list_from_memory.'.
  ENDIF.
after this i am using SO_NEW_DOCUMENT_ATT_SEND_API1 to send the o/p through mail.
However i am not getting the desired result as the  function module LIST_FROM_MEMORY takes an o/p list as input,but this is not the case here as xform is not an o/p list. How do i send the xform into memory and then get it back. Kindly help.
Thanks and Regards,
Subhabrata.

Hi,
Please check with the following code.
TABLES: KNA1.
data for send function
DATA DOC_DATA  LIKE SODOCCHGI1.
DATA OBJECT_ID LIKE SOODK.
DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
  WRITE:/ KNA1-KUNNR, KNA1-ANRED.
send data internal table
  CONCATENATE KNA1-KUNNR KNA1-ANRED
                         INTO OBJCONT-LINE SEPARATED BY SPACE.
  APPEND OBJCONT.
ENDSELECT.
insert receiver (sap name)
  REFRESH RECEIVER.
  CLEAR RECEIVER.
  MOVE: 'any_email'_ TO RECEIVER-RECEIVER,                " SY-UNAME
        'X'      TO RECEIVER-EXPRESS,
        'U'      TO RECEIVER-REC_TYPE.
  APPEND RECEIVER.
insert mail description
  WRITE 'Sending a mail through abap'
                 TO DOC_DATA-OBJ_DESCR.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
     EXPORTING
          DOCUMENT_DATA              = DOC_DATA
     IMPORTING
          NEW_OBJECT_ID              = OBJECT_ID
     TABLES
          OBJECT_CONTENT             = OBJCONT
          RECEIVERS                  = RECEIVER
     EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.

Similar Messages

  • HR: Need to Send the Paysilp as a PDF file through Mail to Employees

    Dear All ,
           Need to Send the Paysilp as a PDF file through Mail to Employees.
           can anyone please suggest any Standard Function Modules which takes the Payslip Form as input and convert it into PDF and can send it through mail to the concern employees.
          Can anyone please explain the procedure in detail.
    Thanks in Advance,
    Regards.

    venu,
    below is code which helps to generate pdf ,,,,hope u know how to use the mail sending function
    data:
    fm_name TYPE RS38L_FNAM, "Smart Forms: FM Name
    sf_name TYPE TDSFNAME
    value 'YOUR_FORM_NAME', "Smart Forms: Form Name
    P_OUTPUT_OPTIONS TYPE SSFCOMPOP,
    P_JOB_OUTPUT_INFO TYPE SSFCRESCL,
    P_CONTROL_PARAMETERS TYPE SSFCTRLOP,
    P_LANGUAGE TYPE SFLANGU value 'E',
    P_E_DEVTYPE TYPE RSPOPTYPE.
    data:
    P_BIN_FILESIZE TYPE I,
    P_BIN_FILE TYPE XSTRING,
    P_OTF type table of ITCOO,
    P_DOCS type table of DOCS,
    P_LINES type table of TLINE,
    name type string,
    path type string,
    fullpath type string,
    filter type string,
    guiobj type ref to cl_gui_frontend_services,
    uact type i,
    filename(128).
    GET SMARTFORM FUNCTION MODULE NAME ---
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = sf_name
    IMPORTING
    FM_NAME = fm_name
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 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.
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    I_LANGUAGE = P_LANGUAGE
    I_APPLICATION = 'SAPDEFAULT'
    IMPORTING
    E_DEVTYPE = P_E_DEVTYPE.
    P_OUTPUT_OPTIONS-XSFCMODE = 'X'.
    P_OUTPUT_OPTIONS-XSF = SPACE.
    P_OUTPUT_OPTIONS-XDFCMODE = 'X'.
    P_OUTPUT_OPTIONS-XDF = SPACE.
    P_OUTPUT_OPTIONS-TDPRINTER = P_E_DEVTYPE.
    P_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
    P_CONTROL_PARAMETERS-GETOTF = 'X'.
    ****...................................PRINTING.........................
    CALL FUNCTION fm_name
    EXPORTING
    CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
    OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
    (....) <--- your form import parameters
    IMPORTING
    JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.
    ****...................................CONVERT TO PDF...............
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
    BIN_FILESIZE = P_BIN_FILESIZE
    TABLES
    OTF = P_OTF
    DOCTAB_ARCHIVE = P_DOCS
    LINES = P_LINES
    EXCEPTIONS
    ERR_CONV_NOT_POSSIBLE = 1
    ERR_OTF_MC_NOENDMARKER = 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.
    now you can mail the pdf.
    Reward points if helpful
    Regards,
    jinesh

  • Problem  while sending the mail from sap

    Hi experts,
                     I am facing some problem while sending mail from sap to external mail.
    this is th code i am using but it is not working. plz check and tell me.
    REPORT  ZMAIL_DEMO.
    data: maildata type sodocchgi1.
    data: mailtxt type table of solisti1 with header line.
    data: mailrec type table of somlrec90 with header line.
    start-of-selection.
    break-point.
    clear: maildata, mailtxt, mailrec.
    refresh: mailtxt, mailrec.
    maildata-obj_name = 'TEST'.
    maildata-obj_descr = 'Test'.
    maildata-obj_langu = sy-langu.
    mailtxt-line = 'This is a test'.
    append mailtxt.
    mailrec-receiver = 'SOME MAIL ID'.
    mailrec-rec_type = 'U'.
    append mailrec.
    call function 'SO_NEW_DOCUMENT_SEND_API1'
    exporting
    document_data = maildata
    document_type = 'RAW'
    put_in_outbox = 'X'
    tables
    object_header = mailtxt
    object_content = mailtxt
    receivers = mailrec
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    others = 8.
    if sy-subrc = 0.   "( did not receive any mail) *
    write : 'mail sent'.
    endif.

    Hi,
    Please check with the following code.
    TABLES: KNA1.
    data for send function
    DATA DOC_DATA  LIKE SODOCCHGI1.
    DATA OBJECT_ID LIKE SOODK.
    DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
    DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
      WRITE:/ KNA1-KUNNR, KNA1-ANRED.
    send data internal table
      CONCATENATE KNA1-KUNNR KNA1-ANRED
                             INTO OBJCONT-LINE SEPARATED BY SPACE.
      APPEND OBJCONT.
    ENDSELECT.
    insert receiver (sap name)
      REFRESH RECEIVER.
      CLEAR RECEIVER.
      MOVE: 'any_email'_ TO RECEIVER-RECEIVER,                " SY-UNAME
            'X'      TO RECEIVER-EXPRESS,
            'U'      TO RECEIVER-REC_TYPE.
      APPEND RECEIVER.
    insert mail description
      WRITE 'Sending a mail through abap'
                     TO DOC_DATA-OBJ_DESCR.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_DATA              = DOC_DATA
         IMPORTING
              NEW_OBJECT_ID              = OBJECT_ID
         TABLES
              OBJECT_CONTENT             = OBJCONT
              RECEIVERS                  = RECEIVER
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              DOCUMENT_TYPE_NOT_EXIST    = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR            = 5
              X_ERROR                    = 6
              ENQUEUE_ERROR              = 7
              OTHERS                     = 8.

  • Problem while sending the message using RWB

    Dear All,
    I am facing a problem while sending a message from RWB. I sent the message using Test Message in component monitoring, it says message sent but I am not able to see any message in sxi_monitor.
    When I send the same message using the http client it successfully processed by XI and I can see the success message in sxi_monitor.
    Please let me know if anyone has face similar kind of issue.
    Thanks,
    Alok
    Edited by: Alok Raoka on May 26, 2008 5:08 PM

    Dear All,
    I am facing a problem while sending a message from RWB. I sent the message using Test Message in component monitoring, it says message sent but I am not able to see any message in sxi_monitor.
    When I send the same message using the http client it successfully processed by XI and I can see the success message in sxi_monitor.
    Please let me know if anyone has face similar kind of issue.
    Thanks,
    Alok
    Edited by: Alok Raoka on May 26, 2008 5:08 PM

  • Logo Problem While sending the smart form as an attachment via Email

    Hi ,
    I am using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send the smartforma as an attachement into the mailbox . it is sent correctly but the COLOR LOGO are not coming correctlly .
    I checked the OTF to PDF file is getting converted correctly .i.e. if i am downloading the foem then it is displaying correctly , but in case of sending it to mailbox as an attached PDF file ,the logo are not comming correctly ,
    If anybody faced such type of problem can u please clarify .
    I am thinking the problem is in FM  SO_NEW_DOCUMENT_ATT_SEND_API1 . this FM is not sending the Attached PDF file correctly .
    All the TExt/variables are displaying  correctly in the PDF file except the LOGO.while opening the PDF file one Warnng message is getting displayed : "An error occured while opening the Image" .
    PLease help ..
    Thanks,
    sachi

    Hi,
    Edit your  logo as 256 color bit map image and save it  and upload  into SE78,
    And also better to use this FM :SO_DOCUMENT_SEND_API1  it is good for new versions.
    thanks,
    venkat.
    Edited by: Satya venkat Rao.R on Dec 13, 2011 6:02 AM

  • Problem while running the Profit center Plan/Actual Report in Background

    Hi
    While executing the T.Code s_alr_87009722 (Profit Centre plan/Actual Comparision Report) on fourground it is giving all the profit centers/groups in the particular profit center group. But when i run the same report in back ground mode it is picking only the last profit center in that group. Please help me regarding the same.
    Regards
    Surya

    hi prakash ramu,
    even it is not working. it is directly talking me to spool request..
    i think it is not possible, while ur running the report in background.,
    any how if possible could u pls send me the code...
    thanks
    ramu

  • Problem while sending the *.txt as attachment  with mail

    Hi All,
    I am Using  function module (SO_NEW_DOCUMENT_ATT_SEND_API1) to send Mail with attachment in *.TXT format. But This function module is allowing only 255 char for a row. But the length of my Internal table is 700 char. Is there any another way to process the attachment without disturbing the data,that means need to process all 700 char in the field with out splitting.

    no other way and use mutilple lines as text ( This is possible )
    you want to keep text as multiple lines into internal table use FM
    SWA_STRING_SPLIT - Pass text and maintain length as 255 Charcters

  • Problem while sending IDOC to File Senario

    Hi Experts
        I am having problem while sending the Idoc from SAP R/3 to File
       I have done all the setting in SAP as well in XI but while pushing IDOC
       I am getting error in the transaction sm58 in SAP R/3
      " <b>The service for the client 300(My SAP R/3 client) is not present in Integration
      Directory</b>"
    I can any one explain me what to done on this....all the connections are fine
    Waiting for Response
    Adv points and thanx
    Rakesh

    Reason and Prerequisites
    You send IDocs from system ABC to the exchange infrastructure (XI) of system XIZ, and error messages are issued in system ABC (Transaction SM58) for the IDOC_INBOUND_ASYNCHRONOUS function module.
    This note proposes solutions for the following error messages:
    a) No service for system SAPABC client 123 in the integration directory
    b) Transaction IDX1: Port SAPABC, client 123, RFC destination
    c) ::000
    d) NO_EXEC_PERMISSION: "USER" "Business_System"
    e) IDoc adapter inbound: Error error ...
    Solution
    a) Error message: No service for system SAPABC client 123 in the integration directory
    Solution:
    You send IDocs from system ABC to XI. In the control record of the IDoc, the SNDPOR field contains the value "SAPABC". The client of the sending system is determined by the MANDT field of the control record. The system ID and client are then used to determine a service without party of the type (business-system/business-service):
    Business system
    Activities in the System Landscape Directory (SLD)(Create technical system):
    Create a technical system for system ABC in the SLD, and create the client for this. Do not forget to assign an "ALE logical system" (for example, "ABCCLNT123") to this technical system.
    SLD (Business system):
    You can now explicitly assign a business system to this client.
    For more details, refer to the SLD documentation.
    Activities in system ABC (self-registration in the SLD):
    Alternatively, you can register the system in the SLD in system ABC with Transaction RZ70. You will find detailed information about the SLD registration of systems on the SAP Service Marketplace for the "Exchange Infrastructure" in the document "Exchange_Installation_Guide.pdf".
    In system ABC, you can check your configuration with TransactionSLDCHECK.
    Activities in Integration Directory (import business system from SLD):
    You will find the business systems under Services Without Party in the Integration Services. In the Service menu, you will find the system identifiers, the client, and the corresponding ALE logical system under "Objects"->"Adapter-specific identifiers".
    Use the Import/Update button to copy the data from the SLD, to create business systems, or to update their identifiers.
    Business service
    Activities in the Integration Builder directory:
    You want to create a service without party that is not part of your system infrastructure and is therefore not maintained in the SLD.
    In the Integration Builder directory, you will find the "Business-Services" under Services Without Party. In the Service menu, you will find the system identifiers, the client, and the corresponding ALE logical system under "Objects"->"Adapter-specific identifiers".
    Activate the change list in Integration Directory.
    In system ABC, you can restart the incorrect entry from Transaction SM58 .
    b) Error message: Transaction IDX1: Port SAPABC, client 123, RFC destination
    Solution:
    The Integration Server tries to load the IDoc metadata from the sending system. The IDoc schemas from the Integration Repository cannot be used because they are release-dependent.
    The sending system is determined by the value of the "SNDPOR" field from the IDoc control record (for example, "SAPABC").
    Activities in the central XI system:
    In Transaction IDX1, you can assign an RFC destination to the sending system (for example, "SAPABC"). This must be created beforehand in Transaction SM59.
    Note that the IDoc metadata is cross-client data. In Transaction IDX1, only one entry must be maintained for each system. Only the lowest client is used by the runtime for Idoc metadata retrieval with RFC.
    Ensure that only SAPABC and not "SAPABC_123" is entered in the port name.
    c) Error message: "::000"
    Solution:
    This error occurs if the central XI system tries to load the IDoc metadata from the sending system by RFC.
    There may be several different reasons for the failure of the metadata import, the error is not transferred in full by tRFC completely, and this results in the error message above.
    User cannot log onto sending system
    User/password/client is not correct or the user is logged due to too many failed logons.
    Activities in sender system ABC:
    Transaction SM21 contains entries for failed logons.
    Activities in the central XI system:
    Determine the sending port from the IDoc control record of the IDoc. If the ID of the sending system has the value "ABC", the value of the sending port is "SAPABC". You will find the RFC destination used for the "SAPABC" sending port with the lowest client in Transaction IDX1. In Transaction SM59, you will find the RFC destination containing the maintained logon data .
    User does not have the required authorizations
    Activities in the sender system ABC:
    In Transaction SM21, you will find entries relating to authorization problems and more exact details.
    Contact your system administrator and, if necessary, assign the user the required roles in user administration.
    IDoctyp/Cimtyp cannot be loaded
    Activities in sender system ABC:
    In the sender system, you can check your IDoc types in Transaction WE30 (IDoc type editor)  Take note not only of the errors, but also of the warnings.
    The most common errors are:
    - IDoc type or segments not released
    - Segments that no longer exist are listed in the IDoc type
    - Data elements that do not exist in the DDIC are assigned to fields
      in the segment.
    Contact your system administrator and correct these errors in the IDoc type.
    d) Error message: NO_EXEC_PERMISSION: "User" "Business_System"
    Solution:
    You created a list of users in the directory who are authorized to use the "Business_System". The user in the error message is not on the list.
    Alternatively, the same error is used if you have created a sender agreement with a channel of the IDoc type for the "Business_System" and the interface used. The user in the error message is not contained in the list of all authorized users defined there.
    e) Error message: IDoc adapter inbound: Error error
    Solution:
    You send IDocs to the central XI system, where they are received by the IDoc adapter. The IDocs are converted into IDoc XML, and a corresponding XI message is generated and transferred to the XI Runtime Engine. The Engine tries to read its own business system from the "Exchange Profile". If the Exchange Profile is currently unavailable, the message is not processed and it is returned to the sending system with an error message.
    Regard's
    Prabhakar.....

  • Problem while sending/Receiving request using the HttpURLConnection obj

    Hi,
    We are facing the problem while passing the request in Weblogic.
    Looks like there is some problem with Weblogic while sending/Receiving the request using the HttpURLConnection object.
    Currently we are migrating 2 applications to WebLogic. Application1 to application2 request should pass.
    Below is some example we tried:
    "When we send a request to our code using the SSOAdaptor code (which handles the request/session in our application) which is on the SunOne server the request parameters are received by our code successfully. And also in Create User Functionality of application1 we are sending a request to webpass(which is on Sunone Server) using the HttpURLConnection object and the SOAP request is received successfully by the Webpass."
    Looks like when we send request (using HttpURLConnection) from a server other than Weblogic to a servlet in a Weblogic the request parameters are received with out issues.
    Where as when the request is sent from WebLogic to WebLogic the request parameters are missing some how.
    Is there any issue in Weblogic? Please helpus on this.
    Thanks,
    Nagesh
    Edited by: user9307541 on Mar 15, 2010 5:08 AM

    Hi,
    Please find below scenario for testing.
    We have tested the SSOAdaptor code (it is the fucntion name which will send the data from source) locally by hittiing the WPS adaptor URL in a Java client program(TestRequest.java) and the request parameters were reaching the WPS Adapter successfully.
    Then we have written two test servlets to test the communication between SSOAdaptor(TestServlet.java) and WPS adaptor(WPSServlet.java).
    Functionality of TestSevlet: It is sending a request to WPSServelt similar to the way we are doing it in SSOAdaptor.
    Functionality of WPSServlet: It will receive the request parameters and write the parameter Map to console.
    We have deployed and these two servlets(in a single webapplication) on Tomcat server and the request parameters are reaching the WPSServlet successfully.
    Output on Tomcat server:
    before sending request
    **********************Inside WPS Servlet -- the request Map is:{TypeAcc=[Ljava.lang.String;@14e3f41, ServiceName=[Ljava.lang.String;@1acd47, GMEPortalUserID=[Ljava.lang.String;@19b04e2, UserID=[Ljava.lang.String;@5dcec6, Country=[Ljava.lang.String;@b25b9d}
    after sending request
    After this we have deployed these two servlets (with in a single webapplication) on the Weblogic server in Dev machine(path: /apps/usmport/domains/usmport/servers/usmport_admin/upload/ssoAdaptor/WEB-INF/classes/com/gm/gmeportal/security/adaptor) and
    now the request parameters are not reaching the WPSServlet.
    Output on Weblogic Server:
    before sending request
    **********************Inside WPS Servlet -- the request Map is:{}
    after sending request
    Looks like there is some problem with Weblogic while sending/Receiving the request using the HttpURLConnection object.
    When we send a request to WPSAdaptor using the Old SSOAdaptor code which is on the SunOne server the request parameters are received by WPS successfully. And also in Create User Functionality of Portal we are sending a request to webpass(which is on Sunone Server) using the HttpURLConnection object and the SOAP request is received successfully by the Webpass.
    Looks like when we send request (using HttpURLConnection) from a server other than Weblogic to a servlet in a Weblogic the request parameters are received with out issues. Where as when the request is sent from weblogic to weblogic the request parameters are missing some how.
    Please find below javs source code used to test this:
    TestRequest.java
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    public class TestRequest {
         * @param args
         public static void main(String[] args) throws Exception{
              // TODO Auto-generated method stub
              excutePost("http://localhost:8080/Testing/TestServlet", "GMEPortalUserID=captest.wss@it0555&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
              //System.out.println("********** Now the request is from SSO *****************");
              //excuteGet("http://10.156.0.173:7013/channel21/wpsadapter", "GMEPortalUserID=captest.wss@it0554&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
         public static String excutePost(String targetURL, String urlParameters)
         URL url;
         HttpURLConnection connection = null;
         try {
         //Create connection
         url = new URL(targetURL);
         connection = (HttpURLConnection)url.openConnection();
         connection.setRequestMethod("POST");
         connection.setRequestProperty("Content-Type",
         "application/x-www-form-urlencoded");
         connection.setRequestProperty("Content-Length", "" +
         Integer.toString(urlParameters.getBytes().length));
         connection.setRequestProperty("Content-Language", "en-US");
         connection.setUseCaches (false);
         connection.setDoInput(true);
         connection.setDoOutput(true);
         //Send request
         DataOutputStream wr = new DataOutputStream (
         connection.getOutputStream ());
         wr.writeBytes (urlParameters);
         wr.flush ();
         wr.close ();
         //Get Response     
         InputStream is = connection.getInputStream();
         BufferedReader rd = new BufferedReader(new InputStreamReader(is));
         String line;
         StringBuffer response = new StringBuffer();
         while((line = rd.readLine()) != null) {
         response.append(line);
         response.append('\r');
         rd.close();
         System.out.println("Response is:" + response);
         return response.toString();
         } catch (Exception e) {
         e.printStackTrace();
         return null;
         } finally {
         if(connection != null) {
         connection.disconnect();
         public static String excuteGet(String targetURL, String urlParameters) throws Exception
              URL url = new URL(targetURL);
              HttpURLConnection httpurlconnection =
                   (HttpURLConnection) url.openConnection();
              /*httpurlconnection.setRequestProperty(
                   "cookie",
                   constructRequestParams(httpservletrequest.getCookies()));*/
              httpurlconnection.setDoOutput(true);
              httpurlconnection.setDoInput(true);
              httpurlconnection.setRequestProperty(
                   "Content-length",
                   String.valueOf(urlParameters.length()));
              OutputStream outputstream = httpurlconnection.getOutputStream();
              outputstream.write(urlParameters.getBytes());
              outputstream.flush();
              //Get Response     
              try{
         InputStream is = httpurlconnection.getInputStream();
         BufferedReader rd = new BufferedReader(new InputStreamReader(is));
         String line;
         StringBuffer response = new StringBuffer();
         while((line = rd.readLine()) != null) {
         response.append(line);
         response.append('\r');
         rd.close();
         System.out.println("Response from SSO is:" + response);
         return response.toString();
         } catch (Exception e) {
         e.printStackTrace();
         return null;
         } finally {
         if(httpurlconnection != null) {
              httpurlconnection.disconnect();
    TestServlet.java
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * Servlet implementation class TestServlet
    public class TestServlet extends HttpServlet {
         private static final long serialVersionUID = 1L;
    * Default constructor.
    public TestServlet() {
    // TODO Auto-generated constructor stub
         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              doPost(request,response);
         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              //System.out.println("********************** the request Map is:" + request.getParameterMap());
              try {
                   System.out.println("before sending request");
                   excuteGet("http://localhost:7003/ssoAdaptor/WPSServlet", "GMEPortalUserID=captest.wss@it0554&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
                   System.out.println("after sending request");
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public String excuteGet(String targetURL, String urlParameters) throws Exception
              URL url = new URL(targetURL);
              HttpURLConnection httpurlconnection =
                   (HttpURLConnection) url.openConnection();
              /*httpurlconnection.setRequestProperty(
                   "cookie",
                   constructRequestParams(httpservletrequest.getCookies()));*/
              httpurlconnection.setDoOutput(true);
              httpurlconnection.setDoInput(true);
              httpurlconnection.setRequestProperty(
                   "Content-length",
                   String.valueOf(urlParameters.length()));
              OutputStream outputstream = httpurlconnection.getOutputStream();
              outputstream.write(urlParameters.getBytes());
              outputstream.flush();
              //Get Response     
              try{
         InputStream is = httpurlconnection.getInputStream();
         BufferedReader rd = new BufferedReader(new InputStreamReader(is));
         String line;
         StringBuffer response = new StringBuffer();
         while((line = rd.readLine()) != null) {
         response.append(line);
         response.append('\r');
         rd.close();
         //System.out.println("Response from SSO is:" + response);
         return response.toString();
         } catch (Exception e) {
         e.printStackTrace();
         return null;
         } finally {
         if(httpurlconnection != null) {
              httpurlconnection.disconnect();
    WPSServlet.java
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * Servlet implementation class WPSServlet
    public class WPSServlet extends HttpServlet {
         private static final long serialVersionUID = 1L;
    * @see HttpServlet#HttpServlet()
    public WPSServlet() {
    super();
    // TODO Auto-generated constructor stub
         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              System.out.println("**********************Inside WPS Servlet -- the request Map is:" + request.getParameterMap());
         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              doGet(request,response);
    Thanks,
    Nagesh

  • Azure Sql DB Export to Storage Container fails with "An error occurred while sending the request"

    I've built a new VM from which I'm running PowerShell scripts to backup my databases.  It had worked before on an old server for several months, and worked once on the new server, then I upgraded my Azure PowerShell cmdlets, and haven't been able to
    get it to work again.  The new version is 0.8.10.1.
    Below is my source code, with sensitive stuff replaced with ?'s.  When I display the $stctx and $dbctx, they seem to have reasonable values.  I added the IP address of the server as an exception to the db firewall, and I've installed SQL Server
    Mangement Studio and verified that I can connect to the database.  I have a feeling there's something simple I've overlooked.
    Here's are both error messages:
    Start-AzureSqlDatabaseExport : An error occurred while sending the request.
    At C:\Users\Public\PublicCmds\test.ps1:29 char:1
    + Start-AzureSqlDatabaseExport -SqlConnectionContext $dbctx -StorageContext $stctx ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Start-AzureSqlDatabaseExport], HttpRequestException
        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseExport
    Start-AzureSqlDatabaseExport : Error while copying content to a stream.
    At C:\Users\Public\PublicCmds\test.ps1:29 char:1
    + Start-AzureSqlDatabaseExport -SqlConnectionContext $dbctx -StorageContext $stctx ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Start-AzureSqlDatabaseExport], HttpRequestException
        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseExport
    Here is the source code:
    param($dbname)
    if ($dbname -eq $null) {
    write-host "Database code must be specified"
    return
    $password = "????"| ConvertTo-SecureString -asPlainText -Force
    $servercredential = new-object System.Management.Automation.PSCredential("????", $password) 
    $dbsize = 1
    $dbrestorewait = 10
    $dbserver = "????"
    $stacct = $dbname
    $stkey = "????"
    $stctx = New-AzureStorageContext -StorageAccountName $stacct -StorageAccountKey $stkey
    $dbctx = New-AzureSqlDatabaseServerContext -ServerName $dbserver -Credential $servercredential 
    $dt = Get-Date
    $timestamp = "_" + $dt.Year + "-" + ("{0:D2}" -f $dt.Month) + "-" + ("{0:D2}" -f $dt.Day) + "-" + ("{0:D2}" -f $dt.Hour) + ("{0:D2}" -f $dt.Minute)
    $bkupname = $dbname + $timestamp + ".bacpac"
    write-host "db context"
    $dbctx
    write-host "storage context"
    $stctx
    write-host "Backup $dbname to $bkupname"
    Start-AzureSqlDatabaseExport -SqlConnectionContext $dbctx -StorageContext $stctx -StorageContainerName databasebackup -DatabaseName $dbname -BlobName $bkupname

    Hi Brad,
    Mentioned script, with appropriate values, works on my system.
    I'm able to export an Azure SQL database to blob storage. Am using version 0.8.10.1 of cmdlets, so this the same version mentioned in this problem description.
    Can you please try using Add-AzureAccount and check if that helps. This is indicated in a different third-party blog.
    http://answers.flyppdevportal.com/categories/azure/azuretroubleshooting.aspx?ID=8aee89fe-430e-45fe-af54-7c8ed3ac60e1%29."http://answers.flyppdevportal.com/categories/azure/azuretroubleshooting.aspx?ID=8aee89fe-430e-45fe-af54-7c8ed3ac60e1
    Does it work from a different machine with newly downloaded credentials.
    Does it work for a newly created database (so minimal database size).
    If above do not work, we may require additional details like RequestID, StorageAccountName, ServerName so an MS ticket may be more appropriate.
    Girish Prajwal

  • Problem while sending FAX through PRINT_TEXT    FM

    Hi All,
    I have a problem while sending a fax.
    we are sending fax through the FM PRINT_TEXT.
    Below is the FM we are passing paramenters.
    CALL FUNCTION 'PRINT_TEXT'
           EXPORTING
                APPLICATION              = 'TX'
                DEVICE                   = 'TELEFAX'
                DIALOG                   = SPACE
                HEADER                   = fs_header
                OPTIONS                  = fs_popt
           IMPORTING
                RESULT                   = fs_pres
           TABLES
                LINES                    = <b>int_fax</b>
           EXCEPTIONS
                CANCELED                 = 1
                DEVICE                   = 2
                FORM                     = 3
                OPTIONS                  = 4
                UNCLOSED                 = 5
                UNKNOWN                  = 6
                FORMAT                   = 7
                TEXTFORMAT               = 8
                COMMUNICATION            = 9
                BAD_PAGEFORMAT_FOR_PRINT = 10
                OTHERS                   = 11.
      if sy-subrc ne 0.
        p_flag = lit_x.
      endif.
    In INT_FAX internal table we have two fields one is tdformat second one is tdline
    The lengh of the TDLINE is 132 char,Initially for all reocords we have only 108 char length,But according to user requirement we added one more field in taht
    Now the lengh increased to 132 for each records.
    When i checked in debugg mode the INT_FAX internal table have all 132 characters.
    The problem is while checking in SOST trnasaction it is showing 108 characters in one line and remaining in second line,can you please help on this.
    Thanks In advance
    Sriman.

    may it be that in those cases where it doesnt work, that you got no fax number?
    Since it works soemtimes, it seems there are no errors, but rather in some cases some important info is missing, fax number may be one of thsoe important info in a FAX scenario.

  • Problem while sending unicode (utf-8) xml to IE.

    Hi,
    I have encoding problem while sending utf-8 xml from servlet to IE (Client), where i am parsing the xml using Ajax.
    In the log I can see proper special characters that are being sent from the servlet. but when same is seen in the client end,, it is showing ? symbols instead of special charcters.
    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new StreamResult(new OutputStreamWriter(stream, "iso-8859-1")));
    _response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _response.getWriter().println(new String(stream.toByteArray(),  "UTF-8"));
    In the log i can see :
    <response status="success" value="1154081722531" hasNextPage="false" hasPreviousPage="false" ><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd �" mode="edit" column_en_US="asdasd �" column_de_DE="? xyz" column_fr_FR="" ></row></response>
    But in the Client side I am able to see
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <response status="success" value="1154082795061" hasNextPage="false" hasPreviousPage="false"><row row_id="PARTY_test_asdasd" column_0="PARTY_test_asdasd" column_1="asdasd ?" mode="edit" column_en_US="asdasd ?" column_de_DE="? xyz" column_fr_FR=""/></response>
    I am getting ? instead of �.
    It will be greatful if somebody tell how to send utf xml from servlet, for ajax purpose.
    Thanks,
    Siva1

    This is the code that sends the xml from servlet.
    ByteArrayOutputStream stream = new
    ByteArrayOutputStream(2000);
    transformer.transform(new DOMSource(document), new
    StreamResult(new OutputStreamWriter(stream,
    "iso-8859-1")));Here you produce XML that's encoded in ISO-8859-1. (!!!)
    _response.setContentType("text/xml; charset=UTF-8");Here you tell the browser that it's encoded in UTF-8.
    _response.getWriter().println(new String(stream.toByteArray(), "UTF-8"));Here you convert the XML to a String, assuming that it was encoded in UTF-8, which it wasn't.
    Besides shooting yourself in the foot by choosing ISO-8859-1 for no good reason, you're also doing a lot of translating from bytes to chars and back again. Not only is that a waste of time, it introduces errors if you don't do it right. Try this instead:_response.setContentType("text/xml; charset=UTF-8");
    _response.setHeader("Cache-Control", "no-cache");
    _transformer.transform(new DOMSource(document_),
                    new StreamResult(_response.getOutputStream()));

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • Error while sending the email notifcation

    Hi All
    I am getting this error while sending the email notifcation.If any one of you have any idea regarding this please suggest
    [2012-09-12T03:55:41.288-10:00] [soa_server1] [ERROR] [SDP-26102] [oracle.sdp.messaging.driver.email] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: OracleSystemUser] [ecid: f5c1f5acbf0bb7a6:22e05768:139ba096e4d:-8000-00000000000006ef,0] [APP: usermessagingdriver-email] Error while writing e-mail message content.[[
    java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
         at java.util.Vector.elementAt(Vector.java:427)
         at javax.mail.Multipart.getBodyPart(Multipart.java:157)
         at javax.mail.internet.MimeMultipart.getBodyPart(MimeMultipart.java:256)
         at oracle.sdpinternal.messaging.driver.email.EmailDriver.getHeaderEncoding(EmailDriver.java:1079)
         at oracle.sdpinternal.messaging.driver.email.EmailDriver.send(EmailDriver.java:670)
         at oracle.sdpinternal.messaging.driver.email.EmailManagedConnection.send(EmailManagedConnection.java:50)
         at oracle.sdpinternal.messaging.driver.DriverConnectionImpl.send(DriverConnectionImpl.java:41)
         at oracle.sdpinternal.messaging.dispatcher.DriverDispatcherBean.onMessage(DriverDispatcherBean.java:296)
         at sun.reflect.GeneratedMethodAccessor2553.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy346.onMessage(Unknown Source)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:574)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:379)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
         at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
         at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [2012-09-12T03:55:41.331-10:00] [soa_server1] [WARNING] [SDP-25107] [oracle.sdp.messaging.engine.store] [tid: [ACTIVE].ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: OracleSystemUser] [ecid: f5c1f5acbf0bb7a6:22e05768:139ba096e4d:-8000-00000000000006ef,0] [APP: usermessagingserver] Message ID bac38bd50a1f32a129c5c739335a7855 in Status object does not match previously recorded Message ID b7e259a30a1f32a12c981a3ffd343f6d.
    [2012-09-12T03:55:41.362-10:00] [soa_server1] [ERROR] [] [oracle.soa.services.notification] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@3066bad4] [userId: <anonymous>] [ecid: 0000Jau4qHj9Lex_w9w0yW1GK6Rn000003,1:32530] [APP: soa-infra] <.> Error status received from UMS.[[
    Status detail :
         Status type : DELIVERY_TO_GATEWAY:FAILURE,
         Status Content : Failed to set message headers: java.lang.ArrayIndexOutOfBoundsException: 0 >= 0,
         Addressed to : EMAIL:[email protected],
         UMS Driver : Farm_base_domain/base_domain/soa_server1/usermessagingdriver-email:oracle_sdpmessagingdriver_email#Email-Driver,
         UMS Message Id : b7e259a30a1f32a12c981a3ffd343f6d,
         Gateway message Id : ,
         Status Received at : Wed Sep 12 03:55:41 HST 2012.
    Check status details and fix the underlying reason, which caused error.
    [2012-09-12T03:55:51.492-10:00] [soa_server1] [WARNING] [] [oracle.soa.services.notification] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@3066bad4] [userId: <anonymous>] [ecid: 0000Jau4qHj9Lex_w9w0yW1GK6Rn000003,1:32530] [APP: soa-infra] <.> Could not find notification record corresponding to failed notification : (Channel message id) : b7e259a30a1f32a12c981a3ffd343f6d[[
    Hence it will not be retried.
    Possible cause could be purging of notification data after sending out notification, but before receiving status.
    ]]

    Are you using your email address to send the email notifications if it Is not configured with AD? Have you populated the mail attribute in weblogic console-->realms-->my realms-->users
    In addition are you sure you have configured the 'Email Driver Properties' correctly in EM ?? have you specified the Notification Mode to Email ?
    Please make sure that the outgoing mail server and port along with the username and password are correct.
    Also validate the workflow settings in your EM?
    In addition, please validate that when you logon to BPM worklist using the admin account and click on the name for e.g. weblogic, you see the email attribute populated properly.
    Thanks
    ACM

  • Error while sending the data using input schedule

    Dear Friends,
    I am unable to send the data using input schedule due to following error is occur while sending the data.
    The Error Message : Member (H1) of dimension (ENTITY) is not a base member (parent or formula)
    Can anyone please help me to resolve the above error.
    Thanks and regards,
    MD.

    Hi,
    You are trying to send data to a parent/node, you can only send data in BPC to lowest-level children (base mamabers) of any dimension.
    "H1" is a parent in the entity dimension so you should try sending to a child.
    Tom.

Maybe you are looking for