Insert fields in a report header using SortValue() function  (PLD)

Hi...
I need to create a user report, based on a query, that shows the following fields.
CardCode |  CardName | Phone1  | E_mail  (header)
Adress   | AddrType  | Street   | Streetno ...(repetitive area)
I have inserted only one filed sucessfully using the <Group 1> and adding the SortValue() function  in the header with the cardcode field...
How can i insert the other fields in the header?
thanks...

I just put a formula in the header with the Field name...and works fine...
Thanks....

Similar Messages

  • How to get field separator in flat file using GUI_DOWNLOAD function

    hi,
    how to get field separator in flat file using GUI_DOWNLOAD function.
                                    thanking you.

    Hi,
      Use WRITE_FIELD_SEPARATOR = 'X'.
      Check this sample code
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:\flight.xls'
       FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    *   CONFIRM_OVERWRITE             = ' '
    *   NO_AUTH_CHECK                 = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   WRITE_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = t_head
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    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 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      IF sy-subrc <> 0.
    *  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Report Painter insert blank line after report header

    Hi Expert,
    I have a problem to insert a blank line (a spacing) after the report header of my customized report painter.
    For example, in standard cost center report, S_ALR_87013611, there is a small box listed information like cost center/group ... and reporting period.
    Right after reporting period, the report header box ends, and there is a space line between it and the cost element data ...
    For my customized report painter, I cannot make this space line.
    I tried edit > row > insert blank line ... but not successful ... kindly advise.
    Thanks and regards,
    -CK

    Hi
    In KKO2 go to output tab, here under layout, tick header and then press pencil symbol and in the editor you write your header. I think this will give you desired result.
    Regards
    Rajneesh Saxena

  • Concatenate text to field value in report header

    I'm trying to concatenate text to field value in a textbox in the report header but am getting an error.  Here's how I'm doing it:
    =First(Fields!Pp_Name.Value, "dsProspect") & "Prospect"
    and the error says the report definition is invalid.  An unexpected error occurred while compiling expressions.  Native compiler return value '[BC30179] class 'Textbox.....
    any idea why this wont compile?
    Thank you.

    Hi moondaddy,
    Generally, the error message always occurred when there are two distinct text boxes with the same name that only differ in their name by casing in report. When Reporting Services generates VB code for these textboxes during report publishing, the compilation
    fails because VB class names are considered case-insensitive.
    So this issue is not related to the expression (the format is correct) you post, it related to the Textbox name that the error message said. In order to fix this issue, please rename one of the textboxes.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click here.
    Katherine Xiong
    TechNet Community Support

  • Modify Report Header using an expression

    Hi All,
    I would like to know if we can modify the Report Header programmatically? I basically would like to append a couple of lines in the header.
    I can think of two ways -
    1. ModifyReportHeader callback - this is really not an option for me as we need to do the implementation in a custom step.
    2. Override the default reportgen_txt.seq and reportgen_html.seq and edit them as necessary - this one seems a bit ugly to me.
    Any other ideas?
    thanks and regards,
    aCe
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.
    Solved!
    Go to Solution.

    Ray,
    Sorry, I if I was not clear earlier.
    This custom step would be used by a test sequence developer who has very little understanding of TestStand.
    The idea is that the person would drag and drop this step in to a sequence and add details of the Unit under test during edit-time which then should appear in the report header along with serial numbers etc. when the program is run. 
    For example, data such as:
    Test Specification: X123-456-789 Issue x
    Unit Part#: xxxxxxx
    Interface Part# xxxxxxxxxxxx
    Asking someone to add the callback would then require TestStand skills and would defeat our goal of trying to deskill this operation.
    I hope I am making sense!
    Thanks and regards,
    aCe
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Condition field in XL Reporter Get Other Data function

    I want to use the XL Reporter "Get Other Data" function to get data from a file not in the current Business Partner dimension  BPA.  Using the SalesPerson code SlpCode, I want to get the SalesPerson Name, SlpName. What is the value for the condition field to restrict the retrieval to just the one record that matches the SlpCode in the BPA dimension?  I've tried ocrd.SlpCode=oslp.SlpCode.  I've tried SlpCode=oslp.SlpCode. But I either get all the names in the Salesperson file or I get some type of syntax error.

    Jim,
    When you say I should be able to pass a parameter, do you mean while using the XLR "Get other data" function?  I thought that's what I was doing when I filled out the Get other data screen with the userid, password, then I specified the OSLP table, requesting SlpName in the Fields section, and then in Condition, I specified OCRD.SlpCode = OSLP.SlpCode.   When the report ran, I got a "#ixGetData error: The multi-part identifier "OCRD.SlpCode" could not be bound".   I tried substituting the BPA dimension qualifier, ie: BPA.SlpCode, but got the same error.
    If I removed the initial qualifier in the Condition field, ie: SlpCode = OCRD.SlpCode, when I ran the report I got ALL Salespersons names, not just the one that matched the SlpCode field on the current Business Partner line.

  • How to insert  WorkBench Request to a domain using a function Module...

    Dear ALL,
                        I am creating a program where I have created a domain using a Function Module and assigned the same domain to a package using a Function Module. Now I want to assign the domain to a WorkBench Request...Can anyone tell me of a Function Module to achieve the same???  Please note that the WorkBench Request is entered by the user on the Selection-Screen.
    Moderator message: please do not open multiple threads for the same issue, rather follow up (or bump up) on existing ones.
    Edited by: Thomas Zloch on Dec 15, 2010 1:18 PM

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • Error on Report when using timestamp functions

    I have been trying to generate a report with the sales pipeline for the following 12 months. The filter I have used is:
    (Opportunity."Close Date" >= TIMESTAMPADD(SQL_TSI_DAY,Current_Date,365)
    but seems to be there is something wrong, can anybody help me??
    Message was edited by:
    user612106

    The error shown is:
    S1000. Código: 10058. [NQODBC] [SQL_STATE: S1000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 42884 code: -440 message: [IBM][CLI Driver][DB2/AIX64] SQL0440N No authorized routine named "TIMESTAMP_ISO" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884 . [nQSError: 16002] Cannot obtain number of columns for the query result. (S1000)

  • Want to update field from product to asset using JoinFieldValue function

    I am trying to write a workflow with JoinField Value Function so that I will get the Field Value=Product Quantity from Product(Content Management) in Asset which is the related information under Account.
    In Asset on the basis of Product Name & ProductID, i want to update that field=Product Quantity in Asset.
    JoinFieldValue('<product>','<productid>','<product quantity>')
    i have tried this workflow under Asset record type with Trigger Event as When Modified record Saved.
    I need this to see the product quantity frm product for Available to Promise purpose.
    Pls help me out.
    Regards
    Mangesh

    Tnaks Venky for your Reply.
    I have written the exact workflow.
    I have created the Custom Field as Product Quantity in Product.In Account record type related info I have renamed Asset as Product Purchased & added field Product name & Product Quantity(Custom Field-Number) as read only.I have aslo added the productID Field(renamed from row ID in both product & assest record type).
    Product Name=A ProductID=123 Product Quantity=READ ONLY ---PQ & PID are coming from Product record type.Same way i want the Product Quantity field should come from Product Record type.
    If i require Product A from Product record Type(Inventory) with 10 Quantity in Required Product Quantity as Custom Field then when i save the Information or as a Modified Information,the Product Quantity field shoul be automatically upadted with the Value provided in Product Quantity field in Product Record Type.
    Regards
    Mangesh

  • Select parameter in report heading

    Hi all,
    I have defined a date parameter as
    Select-options: S_NACD2 FOR Z_VIEW_GITREPORT-BL_DATE OBLIGATORY. (It is a date type select option)
    I have defined report heading as :
    CALL FUNCTION 'HR_DISPLAY_BASIC_LIST'
    EXPORTING
    BASIC_LIST_TITLE   = 'GIT Against Import POs'"sy-title
       FILE_NAME       = 'HR_DISPLAY_BASIC_LIST'
       HEAD_LINE1      = GIT_REPORT_ID
       HEAD_LINE2      = DATE
       HEAD_LINE3      = USER_NAME
       HEAD_LINE4      = RECS_FOUND
       CURRENT_REPORT  = 'HR_DISPLAY_BASIC_LIST'
    TABLES
       DATA_TAB        = IT_GIT
       FIELDNAME_TAB   = MTAB_FIELDNAMES.
    EXIT.
    What I want that after heading ''GIT Against Import POs'' , value in S_NACD2 should appear like :
    GIT Against Import POs  25.11.2007    31.11.2007.
    How can I do that??
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    hi Aisha Ishrat
    declare a variable
    data: loc_variable(200).
    then concatenate 'GIT Against Import POs' ' POs' ' 25.11.2007' ' 31.11.2007' into loc_variable.
    then pass BASIC_LIST_TITLE =  loc_variable.
    hope u ll get.
    regards
    karthik

  • BAL_LOG_MSG_CUMULATE.. use of Function module?

    Hi,
    Thanks for spending the time on this Query.
    I need to use this fn.module(BAL_LOG_MSG_CUMULATE). This fun.module is to get cumulating value and this value put into MSG_COUNT in the structure BAL_S_MSG while adding the messages to the log header using the function module(BAL_LOG_MSG_ADD). If I am using the 'cumulate' fn.module What is the major difference while I am adding the messages in the Application log?
    If I am not filling the values in the field 'MSG_COUNT', but messages are added smoothly to the log header.  So, I didn't get what is the use of the Cumulate function module.
    I have very less time to analyses this issue so that, I need to use your time to find out the issue.  Thanks in advance for the advisors.
    Plz advise what is the scenario to use this fun.module?
    Thanks,
    Sridhar Choda.

    this function module creates a message containing whatever text you want but only upto a limit of 200 characters. Actually it cheats the system by creating a message and breaking up the free text into 4 chunks of 50 charatcers, 1 chunk for each of the 4 symsgv variables. It uses message class BL and message 001 which is defined as & & & &, so it's completely free-format.
    If you want to have a bigger field you'll need to use another technique altogether.

  • Using package functions in an update

    Okay, I have a package function that returns a correct value when used in a SELECT, but when used in an UPDATE, it returns Null. Why can't I used its result in the UPDATE?
    Package Spec
    FUNCTION fpub_get_contract_attribute
         (     n_contract_id_in                    IN               CONTRACT.CONTRACT_ID%TYPE,
              s_attribute_in                         IN               VARCHAR2 )
    RETURN VARCHAR2;
    PRAGMA RESTRICT_REFERENCES(fpub_get_contract_attribute,TRUST,WNDS);
    Source :
    clear;
    rollback;
    select
         contract_functions.fpub_get_contract_attribute(CONTRACT_ID,'ORIGINAL_SALES_CHANNEL') "Before",
         original_sales_channel
    from contract
    where contract_id = 52549615;
    update contract
    set original_sales_channel = NVL(contract_functions.fpub_get_contract_attribute(CONTRACT_ID,'ORIGINAL_SALES_CHANNEL'),'Null')
    where contract_id = 52549615;
    select
         NVL(contract_functions.fpub_get_contract_attribute(52549615,'ORIGINAL_SALES_CHANNEL'),'Null') "After",
         original_sales_channel
    from contract
    where contract_id = 52549615;
    rollback;
    Result :
    Rollback complete
    Before                ORIGINAL_SALES_CHANNEL
    RE                                                                              
    1 row updated
    After                 ORIGINAL_SALES_CHANNEL
    Null                  Null
    Rollback completeAny ideas?
    Thanks,
    Jason

    Pragma restrict_references has not been required since 8i, so you can get rid of that. However, certain things will still be enforced, with or without the pragma. For example, you cannot perform DML from within a packaged function when that function is used in a select statement, although you can perform DML within a packaged function when it is used in an update statement. So, if you are performing some sort of DML in your function, it would not raise an error when used in the update statement, but would cause it to return whatever is specified in the exception block when used in a select statement, causing the different results.
    Please see the demonstration below in which I have created a sample function that contains an insert statement. When I use the function from a select statement, it raises an error and does not insert a row. However, when I use the function in an update statement, it does not raise an error and inserts a row. I have then added an exception clause to the function and re-tested. When I used the function in a select statement, it now returns the value in the exception block, but still does not insert a row. When I used the function in an update statement, it returns a different value, not from the exception block, and inserts a row. Then I removed the insert statement from the function and re-tested. Now it returns the same value, whether used in a select statement or an update statement.
    scott@ORA92> SELECT banner FROM v$version
      2  /
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE     9.2.0.1.0     Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    scott@ORA92> CREATE TABLE test
      2    (col1 VARCHAR2(30))
      3  /
    Table created.
    scott@ORA92> CREATE TABLE contract
      2    (contract_id            NUMBER,
      3       original_sales_channel VARCHAR2(30))
      4  /
    Table created.
    scott@ORA92> INSERT INTO contract (contract_id) VALUES (52549615)
      2  /
    1 row created.
    scott@ORA92> COMMIT
      2  /
    Commit complete.
    scott@ORA92> CREATE OR REPLACE PACKAGE contract_functions
      2  AS
      3    FUNCTION fpub_get_contract_attribute
      4        (n_contract_id_in IN CONTRACT.CONTRACT_ID%TYPE,
      5         s_attribute_in   IN VARCHAR2 )
      6        RETURN            VARCHAR2;
      7  END contract_functions;
      8  /
    Package created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> -- test with insert statement and no exception handling:
    scott@ORA92> CREATE OR REPLACE PACKAGE BODY contract_functions
      2  AS
      3    FUNCTION fpub_get_contract_attribute
      4        (n_contract_id_in IN CONTRACT.CONTRACT_ID%TYPE,
      5         s_attribute_in   IN VARCHAR2 )
      6        RETURN            VARCHAR2
      7    IS
      8    BEGIN
      9        INSERT INTO test (col1) VALUES ('inserting');
    10        RETURN 'Null';
    11    END fpub_get_contract_attribute;
    12  END contract_functions;
    13  /
    Package body created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> SELECT * FROM contract
      2  /
    CONTRACT_ID ORIGINAL_SALES_CHANNEL
       52549615
    scott@ORA92> COLUMN "Before" FORMAT A30
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "Before",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "Before",
    ERROR at line 1:
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "SCOTT.CONTRACT_FUNCTIONS", line 9
    scott@ORA92> SELECT * FROM test
      2  /
    no rows selected
    scott@ORA92> update contract
      2  set    original_sales_channel = NVL (contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL'), 'Null')
      3  where  contract_id = 52549615
      4  /
    1 row updated.
    scott@ORA92> SELECT * FROM test
      2  /
    COL1
    inserting
    scott@ORA92> COLUMN "After" FORMAT A30
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "After",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "After",
    ERROR at line 1:
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "SCOTT.CONTRACT_FUNCTIONS", line 9
    scott@ORA92> SELECT * FROM test
      2  /
    COL1
    inserting
    scott@ORA92> --
    scott@ORA92> -- repeat test with insert statement and exception handling:
    scott@ORA92> ROLLBACK
      2  /
    Rollback complete.
    scott@ORA92> CREATE OR REPLACE PACKAGE BODY contract_functions
      2  AS
      3    FUNCTION fpub_get_contract_attribute
      4        (n_contract_id_in IN CONTRACT.CONTRACT_ID%TYPE,
      5         s_attribute_in   IN VARCHAR2 )
      6        RETURN            VARCHAR2
      7    IS
      8    BEGIN
      9        INSERT INTO test (col1) VALUES ('inserting');
    10        RETURN 'Null';
    11    EXCEPTION
    12        WHEN OTHERS THEN RETURN 'RE';
    13    END fpub_get_contract_attribute;
    14  END contract_functions;
    15  /
    Package body created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "Before",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    Before                         ORIGINAL_SALES_CHANNEL
    RE
    scott@ORA92> SELECT * FROM test
      2  /
    no rows selected
    scott@ORA92> update contract
      2  set    original_sales_channel = NVL (contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL'), 'Null')
      3  where  contract_id = 52549615
      4  /
    1 row updated.
    scott@ORA92> SELECT * FROM test
      2  /
    COL1
    inserting
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "After",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    After                          ORIGINAL_SALES_CHANNEL
    RE                             Null
    scott@ORA92> SELECT * FROM test
      2  /
    COL1
    inserting
    scott@ORA92> --
    scott@ORA92> -- repeat test with no insert statement and no exception handling:
    scott@ORA92> ROLLBACK
      2  /
    Rollback complete.
    scott@ORA92> CREATE OR REPLACE PACKAGE BODY contract_functions
      2  AS
      3    FUNCTION fpub_get_contract_attribute
      4        (n_contract_id_in IN CONTRACT.CONTRACT_ID%TYPE,
      5         s_attribute_in   IN VARCHAR2 )
      6        RETURN            VARCHAR2
      7    IS
      8    BEGIN
      9        RETURN 'Null';
    10    END fpub_get_contract_attribute;
    11  END contract_functions;
    12  /
    Package body created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "Before",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    Before                         ORIGINAL_SALES_CHANNEL
    Null
    scott@ORA92> SELECT * FROM test
      2  /
    no rows selected
    scott@ORA92> update contract
      2  set    original_sales_channel = NVL (contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL'), 'Null')
      3  where  contract_id = 52549615
      4  /
    1 row updated.
    scott@ORA92> SELECT * FROM test
      2  /
    no rows selected
    scott@ORA92> select contract_functions.fpub_get_contract_attribute (CONTRACT_ID, 'ORIGINAL_SALES_CHANNEL') "After",
      2           original_sales_channel
      3  from   contract
      4  where  contract_id = 52549615
      5  /
    After                          ORIGINAL_SALES_CHANNEL
    Null                           Null
    scott@ORA92> SELECT * FROM test
      2  /
    no rows selected
    scott@ORA92>

  • Need help to modify a report written using Field-Groups Concept. - Part1

    Hello ABAP Experts,
    I need your help to modify the following report with following requirement as I have least knowledge
    about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our
    production requirement. I really appreciate your help, If its sent modifying the code required.
    Modification required in the report.
    To allow the sales representatives to see billed shipments and open orders for the current month.
    1) Selection Screen Changes:
    u2022     Add selection by Sales group and Customer group
    u2022     Add sort by:     3. Ship-to / Material
    u2022     Add another selection box
    [ ] Open Orders and Shipments with the current month
    2)      For the new selection box, subtotal sales quantity and delivery quantity.
         If delivered, make the sales quantity zero in the subtotal
    Current report displays, in Selection Screen
    Sales org:
    Person Name:
    Material:
    Plant:
    Sales Office:
    Ship to Name:
    Ship to Number:
    Sorts Report by : 1. Person Name 2. Material
    Check Boxes : 1. Open Orders 2. Delayed Orders.
    report  zorder  LINE-SIZE 170
                      LINE-COUNT 58
                      MESSAGE-ID zv
                      NO STANDARD PAGE HEADING.
    TABLES:
    cdhdr,                                 "Change Doc Header
    cdpos,                                 "Change Doc Item
    kna1,                                  "Customer master
    likp,                                  "Delivery Header
    lips,                                  "Delivery Item
    *lips,                                 "Delivery Item
    zvbpa_lfa1,                            "Vendor Master
    makt,                                  "Material Desc
    t001w,                                 "Plant
    tvkbt,                                 "Sales Office
    tvko,                                  "Sales Organizations
    vbak,                                  "Sales Header
    vbap,                                  "Sales Item
    zvvbak,                                "Sales Hdr - Time calc
    vbup,                                  "Item status
    vbep,                                  "Sales Schedule Line
    vbfa,                                  "Flow documents
    vbpa,                                  "Partners
    vbrk,                                  "Billing Header
    vbrp.                                  "Billing Item
    SELECT-OPTIONS:
      s_vkorg FOR vbak-vkorg OBLIGATORY,
      s_ernam FOR vbak-ernam,
      s_matnr FOR vbap-matnr,
      s_werks FOR vbap-werks,
      s_vkbur FOR vbak-vkbur,
      s_name1 FOR kna1-name1,
      s_kunnr FOR kna1-kunnr.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(49) text-c20.
    PARAMETERS: p_sort TYPE n DEFAULT '1'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-022.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-023.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-024.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-070.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_open AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(48) text-072.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_delay AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(48) text-073.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b20.
    DATA:
    vbeln(11),                             "Document number
    cancel_dt TYPE d,                      "Cancellation Date
    BEGIN OF tabkey,                       "Tabkey
    mandant LIKE sy-mandt,
    vbeln LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    END OF tabkey,
    name1_sp1 LIKE lfa1-name1,             "Sales Carrier Name
    name1_sp2 LIKE lfa1-name1,             "Delivery Carrier Name
    datum-1 TYPE d,                        "Current Dt Less 1
    datum-14 TYPE d,                       "Current Dt Less 14
    datum-90 TYPE d,                       "Current Dt Less 90
    rpt_hdr1(170),                         "Report Header 1
    rpt_hdr2(170),                         "Report Header 2
    rpt_hdr3(170),                         "Report Header 3
    cb_hdr1(170),                          "Control Break Header 1
    line_pos1 TYPE i,                      "Line Print Position HDR1
    line_pos2 TYPE i,                      "Line Print Position HDR2
    line_pos3 TYPE i,                      "Line Print Position DET2
    status,                                "Order Status
    open,                                  "Open Order
    delayed VALUE 'D',                     "Delayed Order
    v_comp(30).                            "Company Text Field
    DATA: v_flagh2.  " Flag for header 2 & 3
    DATA: ls_comwa LIKE vbco6. "Structure for flow information
    DATA: t_vbfa_tab TYPE STANDARD TABLE OF vbfa WITH HEADER LINE."Itab
    for flow information
    data: g_trans_id type vttk-tdlnr. "get transport id from flow
      information
      data  v_sales_org_cpimex type vkorg value  '3300'.
      FIELD-GROUPS:
      header,
      order.
      INSERT
      status                                 "Status
      vbak-vkbur                             "Sales Office
      vbak-ernam                             "Created By
      kna1-kunnr                             "Customer
      kna1-name1                             "Customer Name
      vbap-matnr                             "Material
      vbap-werks                             "Plant
      vbep-lddat                             "Load Dt
      vbap-vbeln                             "Sales Document
      INTO header.
      INSERT
      kna1-ort01                             "City
      kna1-regio                             "Region
      likp-traid                             "Transport ID
      lips-vbeln                             "Delivery Document
      lips-ntgew                             "Net Wt
      lips-gewei                             "Unit of Weight
      vbap-kwmeng                            "Order Qty
      vbap-vrkme                             "Sales Unit
      vbak-bstnk                             "Customer PO
      vbak-erdat                             "Sales Create Dt
      vbak-ihrez                             "PO Release
      vbak-vdatu                            "Req Delivery Dt
      vbak-vzeit                            "Req Delivery Time
      vbfa-vbeln                             "Goods issue doc
      vbrk-vbeln                             "Billing Document
      name1_sp1                              "Sales Carrier
      name1_sp2                              "Delivery Carrier
      INTO order.
    INITIALIZATION.
    AT SELECTION-SCREEN.
      IF NOT p_sort BETWEEN 1 AND 2.
        MESSAGE e022 WITH p_sort.
      ENDIF.
    * Report 1 or more of cancelled, delayed or open
      IF p_open IS INITIAL AND
         p_delay IS INITIAL.
        MESSAGE e023.
      ENDIF.
    START-OF-SELECTION.
    * Load Company Name
      WRITE 'XYZ INC'(000) TO v_comp.
    * Calculate Date Range
      datum-1 = sy-datum - 1.
      datum-14 = sy-datum - 14.
      datum-90 = sy-datum - 90.
    * Compose Parameter Header
      PERFORM parm_hdr.
    ** Compose Report Header
      v_flagh2 = 1.
      PERFORM data_selection.
    END-OF-SELECTION.
    * Determine Sort
      CASE p_sort.
        WHEN 1.
          SORT BY status vbak-ernam kna1-name1 kna1-kunnr
                  vbep-lddat vbap-vbeln.
        WHEN 2.
          SORT BY status vbap-matnr vbap-werks vbep-lddat
                  vbap-vbeln.
      ENDCASE.
      LOOP.
        AT NEW status.
          CASE status.
            WHEN delayed.
              WRITE 'Delayed Orders'(061) TO rpt_hdr1.
            WHEN OTHERS.
              WRITE 'Open Orders'(062) TO rpt_hdr1.
          ENDCASE.
          NEW-PAGE.
        ENDAT.
        AT NEW vbak-ernam.
          IF p_sort = 1.
            CLEAR cb_hdr1.
            WRITE 'CAA:'(064) TO cb_hdr1.
            WRITE vbak-ernam TO cb_hdr1+5.
            NEW-PAGE.
          ENDIF.
        ENDAT.
        AT NEW vbap-matnr.
          IF p_sort = 2.
            CLEAR makt.
            SELECT SINGLE * FROM makt
                WHERE spras = sy-langu AND
                      matnr = vbap-matnr.
            CLEAR cb_hdr1.
            WRITE 'Material:'(042) TO cb_hdr1.
            WRITE vbap-matnr TO cb_hdr1+10.
            WRITE makt-maktx TO cb_hdr1+21.
            NEW-PAGE.
          ENDIF.
        ENDAT.
        AT NEW vbap-werks.
          AT order.
            RESERVE 3 LINES.
            SKIP 1.
            NEW-LINE.
    * Indicate new open item
            WRITE vbap-vbeln TO vbeln.
    * Find Transport ID
    * Fill the structure LS_COMWA
            ls_comwa-mandt = sy-mandt.
            ls_comwa-vbeln = vbap-vbeln.
            CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
              EXPORTING
                comwa    = ls_comwa
              TABLES
                vbfa_tab = t_vbfa_tab.
            IF sy-subrc EQ 0.
              READ TABLE t_vbfa_tab WITH KEY vbtyp_n = '8'.
              IF sy-subrc EQ 0.
                SELECT SINGLE tdlnr INTO g_trans_id
                  FROM vttk WHERE tknum = t_vbfa_tab-vbeln.
                CONDENSE g_trans_id.
              ENDIF.
            ENDIF.
            IF vbak-erdat >= datum-1.
              vbeln+10 = 'N'.
            ENDIF.
            CASE p_sort.
              WHEN 1.
                WRITE 1 vbak-vkbur.
                WRITE 8 kna1-name1.
                WRITE 44 vbeln.
                WRITE 56 vbap-matnr.
                WRITE:
                    75 vbap-kwmeng LEFT-JUSTIFIED,
                     vbap-vrkme,
                    100 vbak-bstnk,
                     vbak-ihrez,
                    134 vbak-vdatu,
                        vbak-vzeit,
                    154 vbep-lddat.
                WRITE 166 vbap-werks.
                NEW-LINE.
                WRITE:
                  5  kna1-ort01,
                  41 kna1-regio.
                IF name1_sp2 IS INITIAL.
                  WRITE:
                    45 name1_sp1,
                ELSE.
                  WRITE 45 name1_sp2.
                  IF name1_sp1 = name1_sp2.
                    WRITE ' '.
                  ELSE.
                    WRITE '*'.
                  ENDIF.
                ENDIF.
                IF  vbak-vkorg =  v_sales_org_cpimex .
                  WRITE  81 g_trans_id.
                ELSE.
                  WRITE  81 likp-traid.
                ENDIF.
                WRITE:
                  102 lips-vbeln,
                  115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
                      lips-gewei,
                  140 vbfa-vbeln,
                  152 vbrk-vbeln.
              WHEN 2.
                WRITE 1 vbak-ernam.
                WRITE 14 vbak-vkbur.
                WRITE 21 kna1-name1.
                WRITE 57 vbeln.
                WRITE:
                    69 vbap-kwmeng LEFT-JUSTIFIED,
                        vbap-vrkme,
                    92 vbak-bstnk,
                        vbak-ihrez,
                    126 vbak-vdatu,
                      vbak-vzeit,
                    146 vbep-lddat.
                WRITE 162 vbap-werks.
                NEW-LINE.
                WRITE:
                  5  kna1-ort01,
                  41 kna1-regio.
                IF name1_sp2 IS INITIAL.
                  WRITE:
                    45 name1_sp1,
                ELSE.
                  WRITE 45 name1_sp2.
                  IF name1_sp1 = name1_sp2.
                    WRITE ' '.
                  ELSE.
                    WRITE '*'.
                  ENDIF.
                ENDIF.
                IF  vbak-vkorg =  v_sales_org_cpimex .
                  WRITE  81 g_trans_id.
                ELSE.
                  WRITE  81 likp-traid.
                ENDIF.
                WRITE:
                   102 lips-vbeln,
                   115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
                       lips-gewei,
                   140 vbfa-vbeln,
                   152 vbrk-vbeln.
            ENDCASE.
          ENDAT.
        ENDLOOP.
    *       FORM PARM_HDR                                                 *
    FORM parm_hdr.
      WRITE 'Program selections'(101) TO rpt_hdr1.
      WRITE 'Sign'(102) TO rpt_hdr1+29.
      WRITE 'Option'(103) TO rpt_hdr1+34.
      WRITE 'From'(104) TO rpt_hdr1+41.
      WRITE 'To'(105) TO rpt_hdr1+77.
    ENDFORM.                    "PARM_HDR
    *       FORM RPT_HDR                                                  *
    FORM rpt_hdr.
      CASE p_sort.
        WHEN 1.               "When sort by CAA
          WRITE 1'SOff'(066).
          WRITE 8'Customer'(009).
          WRITE 44'Sales Doc'(010).
          WRITE 56'Material'(031).
          WRITE 75'Sales Qty'(011).
          WRITE 100'Customer PO'(012).
          WRITE 134'Req.Del.Dt & Tm'(014).
          WRITE 154'Load Dt'(015).
          WRITE 166'Plnt'(016).
          NEW-LINE.
          WRITE 5'City'(017).
          WRITE 41'Reg'(069).
          WRITE 45'Carrier'(018).
          WRITE 81'Transport ID'(019).
          WRITE 102'Dlvry Doc'(021).
          WRITE 115'Dlvry Qty'(025).
          WRITE 140'PGI Doc'(026).
          WRITE 152'Billng Doc'(027).
        WHEN 2.               "When sort by Material
          WRITE 1'Created By'(008).
          WRITE 14'SOff'(066).
          WRITE 21'Customer'(009).
          WRITE 57'Sales Doc'(010).
          WRITE 69'Sales Qty'(011).
          WRITE 92'Customer PO'(012).
          WRITE 126'Req.Del.Dt & Tm'(014).
          WRITE 146'Load Dt'(015).
          WRITE 162'Plnt'(016).
          NEW-LINE.
          WRITE 5'City'(017).
          WRITE 41'Reg'(069).
          WRITE 45'Carrier'(018).
          WRITE 81'Transport ID'(019).
          WRITE 102'Dlvry Doc'(021).
          WRITE 115'Dlvry Qty'(025).
          WRITE 140'PGI Doc'(026).
          WRITE 152'Billng Doc'(027).
      ENDCASE.
    ENDFORM.                    "RPT_HDR
    INCLUDE zrpthdri.
    WRITE:
    / rpt_hdr1.
    ULINE.
    IF v_flagh2 <> 0.
      PERFORM rpt_hdr.  "Write secondary header
      ULINE.
    * Control Break Header
      WRITE / cb_hdr1.
    ENDIF.
    Continued in Part-2
    Thanks  a ton in advance.
    Mythili Sharma
    Edited by: Mythili sharma on Mar 30, 2009 3:32 AM
    Edited by: Rob Burbank on Mar 30, 2009 10:46 AM

    Hello ABAP Experts,
    I need your help to modify the following report with following requirement as I have least knowledge about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our production requirement. I really appreciate your help, If its sent modifying the code required.
    Modification required in the report.
    To allow the sales representatives to see billed shipments and open orders for the current month.
    1) Selection Screen Changes:
    u2022     Add selection by Sales group and Customer group
    u2022     Add sort by:     5. Ship-to / Material
    u2022     Add another selection box
    [ ] Open Orders and Shipments with the current month
    2)      For the new selection box, subtotal sales quantity and delivery quantity.
         If delivered, make the sales quantity zero in the subtotal
    Current report displays, in Selection Screen
    Sales org:
    Person Name:
    Material:
    Plant:
    Sales Office:
    Ship to Name:
    Ship to Number:
    Sorts Report by :
    1. Person Name
    2. Material
    3. Plant
    4. Sales Office
    Check Boxes :
    1. Open Orders
    2. Delayed Orders
    3.Cancelled Orders
    PLEASE DOWNLOAD THE COMPLETE REPORT FROM THE FOLLOWING LINK
    << Link removed >>
    It would be a great help, If the program is modified according to the requirement and snd it back through send space and send link, even if u send the necessary changes to be done in the report is also appreciable.
    Thanks a ton in adanvce
    Mythili
    I wanted to close this thread as I could not put my question in a proper format. So please reply in the new thread which is posted.
    Edited by: Mythili sharma on Mar 30, 2009 2:16 PM
    Edited by: Rob Burbank on Mar 30, 2009 4:24 PM

  • How to add a field object to group header section in crystal report document?

    Hi All, I have got two questions mentioned below, please share your inputs. 1)I want to know whether it is possible to add a field object to header section in crystal report document programmatically? I am using crystal runtime for visual studio. I know that using RAS we can do it, but I want to do it using managed library of crystal runtime. Please suggest. 2) I am doing a POC where I am using RAS (unmanaged library) to manipulated crystal report document. Please see code below: var dbTable = _reportDocument.ReportClientDocument.DatabaseController.Database.Tables[0]; var dbField = dbTable.DataFields.FindField(item.ColumnName,                         CrystalDecisions.ReportAppServer.DataDefModel.CrFieldDisplayNameTypeEnum.crFieldDisplayNameName,                         CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishUS); CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();                     fieldObject.DataSourceName = dbField.Name;                     fieldObject.FieldValueType = dbField.Type; var groupHeaderArea = _reportDocument.ReportClientDocument.ReportDefController.ReportDefinition.GroupHeaderArea[0].Sections[i]; _reportDocument.ReportClientDocument.ReportDefController.ReportObjectController.Add(fieldObject, groupHeaderArea); In above code last line throwing exception : "The report field type is not valid." at CrystalDecisions.ReportAppServer.Controllers.ReportObjectControllerClass.Add(ISCRReportObject ReportObject, Section Section, Int32 nIndex) Thanks, Jai

    Hi Jaikumar
    As per the SCN Rules of engagement, one question per thread please.
    Re. your 1st question. Adding a field to a report is considered to be a report creation APIs (RCAPI). Only the RAS SDK has RCAPIs, so you can not use plain jane crystal APIs. For how to with RAS, see the examples here: NET RAS SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
    Also, consult the Developer Help Files:
    Report Application Server .NET SDK Developer Guide
    Report Application Server .NET API Guide
    Re. your second question, please create a new discussion.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to get prompt value in Financial Reporting and use it as header

    Hi Oracle Gurus,
    I have Hyperion Financial Reporting 11.1.1.3. I created a report.
    I have Products dimension on rows. And I also have prompt for Products.
    Let's say there is 3 products, Product A, B, and C, with each has its own level 0 item (for example A1, A2, B1, C1)
    Currently in my situation, user will be prompted to select a list of Products, and then the report will display only the level 0 of the product chosen by the user. For example, user select Product A, then the report (or the grid) will display A1 and A2 on rows. User select Product B, B1 will be displayed.
    My question is, I want to create a dynamic header report, so how can I get this prompt value and use it as a report header? For example: Sales of Product A when user choose Product A, or Sales of Product B when user choose Product B.
    Thanks a lot for your response.

    Hi,
    Here is the possible way to achieve it:
    1. Insert a row (may be as row 1) in the report which has product as "User prompt".
    2. mark this row as hidden always
    3. User other rows as level0 of product in row 1
    4. Use MEMBERALIAS in your header to use product as dimension & row as row1
    Hope it helps !!
    Edited by: user8628169 on Jun 22, 2011 10:53 AM

Maybe you are looking for