Want to add 2 fields in report ARXAGMW.rdf

Hi,
I want to add to fields in the report ARXAGMW.rdf.
The fields are:
- ps.trx_date transactiedatum, --transactiondate
- ps.amount_due_original factuurbedrag, --transactionamount
I changed the function below. I pasted not the whole code.
But when i run the report i get the error:
MSG-01001: after build_invoice_select
ORA-01789: query block has incorrect number of result columns
==> select rpad ( 'a' , 50 , '-' ) cust_name_inv , rpad ( 'a' , 30 , '-' ) cust_no_inv , rpad ( 'a' , 4000 , '-' ) sort_field1_inv , rpad ( 'a' , 4000 , '-' ) sort_field2_inv , 0 inv_tid_inv , 0 contact_site_id_inv , rpad ( 'a' , 60 , '-' ) cust_state_i
FUNCTION BUILD_INVOICE_SELECT
RETURN LONG IS
l_inv_sel LONG;
l_inv_sel1 LONG;
l_inv_sel2 LONG;
l_inv_sel3 LONG;
l_inv_sel4 LONG;
l_inv_sel5 LONG;
new_line VARCHAR2(10) := '
BEGIN
-- BUILD FIRST SELECT STATEMENT
srw.message('1000','inside build_invoice_select');
srw.message('1001','*** BUILDING SELECT #1 All outstanding transactions ***');
l_inv_sel1 :=
'select substrb(party.party_name,1,50) cust_name_inv,
cust_acct.account_number cust_no_inv,';
l_inv_sel1 := l_inv_sel1 || new_line;
if (:p_rep_type = 'ARXAGS') then
l_inv_sel1 := l_inv_sel1 || 'decode(upper(:p_in_sortoption),''CUSTOMER'',NULL,
arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id))';
elsif (:p_rep_type = 'ARXAGL') then
l_inv_sel1 := l_inv_sel1 || 'col.name';
elsif(:p_rep_type = 'ARXAGR') then
l_inv_sel1 := l_inv_sel1 || 'sales.name';
elsif(:p_rep_type = 'ARXAGF') then
l_inv_sel1 := l_inv_sel1 || :lp_accounting_flexfield;
end if;
l_inv_sel1 := l_inv_sel1 ||
' sort_field1_inv,' || new_line;
l_inv_sel1 := l_inv_sel1 ||
'arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id) sort_field2_inv,' || new_line;
if (:p_rep_type = 'ARXAGS') then
l_inv_sel1 := l_inv_sel1 ||
'decode(upper(:p_in_sortoption),''CUSTOMER'',-999,ps.cust_trx_type_id)';
elsif (:p_rep_type = 'ARXAGL') then
l_inv_sel1 := l_inv_sel1 || 'col.collector_id';
elsif(:p_rep_type = 'ARXAGR') then
l_inv_sel1 := l_inv_sel1 || 'nvl(sales.salesrep_id, -3)';
elsif(:p_rep_type = 'ARXAGF') then
l_inv_sel1 := l_inv_sel1 || 'c.code_combination_id';
end if;
l_inv_sel1 := l_inv_sel1 || ' inv_tid_inv, ';
l_inv_sel1 := l_inv_sel1 ||
' site.site_use_id contact_site_id_inv,
loc.state cust_state_inv,
loc.city cust_city_inv,
decode(:format_detailed,NULL,-1,acct_site.cust_acct_site_id) addr_id_inv,
nvl(cust_acct.cust_account_id,-999) cust_id_inv,
ps.payment_schedule_id payment_sched_id_inv,
ps.class class_inv,
ps.due_date due_date_inv,
amt_due_remaining_inv,
ps.trx_number invnum,
ceil(to_date(:as_of_date) - ps.due_date) days_past_due,
ps.amount_adjusted amount_adjusted_inv,
ps.amount_applied amount_applied_inv,
ps.amount_credited amount_credited_inv,
ps.gl_date gl_date_inv,
     ps.trx_date transactiedatum,
     ps.amount_due_original factuurbedrag,
decode(ps.invoice_currency_code, :functional_currency, NULL,
decode(ps.exchange_rate, NULL, ''*'', NULL)) data_converted_inv,
nvl(ps.exchange_rate, 1) ps_exchange_rate_inv, '
l_inv_sel1 := l_inv_sel1 ||
' arpt_sql_func_util.bucket_function(:bucket_line_type_0,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_0,:bucket_days_to_0,
ps.due_date,:bucket_category,to_date(:as_of_date)) b0_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_1,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_1,:bucket_days_to_1,
ps.due_date,:bucket_category,to_date(:as_of_date)) b1_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_2,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_2,:bucket_days_to_2,
ps.due_date,:bucket_category,to_date(:as_of_date)) b2_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_3,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_3,:bucket_days_to_3,
ps.due_date,:bucket_category,to_date(:as_of_date)) b3_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_4,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_4,:bucket_days_to_4,
ps.due_date,:bucket_category,to_date(:as_of_date)) b4_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_5,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_5,:bucket_days_to_5,
ps.due_date,:bucket_category,to_date(:as_of_date)) b5_inv,
arpt_sql_func_util.bucket_function(:bucket_line_type_6,
dh.amount_in_dispute,ps.amount_adjusted_pending,
:bucket_days_from_6,:bucket_days_to_6,
ps.due_date,:bucket_category,to_Date(:as_of_date)) b6_inv,';
l_inv_sel1 := l_inv_sel1 || :lp_acct_flex_bal_seg || ' company_inv,';
l_inv_sel1 := l_inv_sel1 || :lp_query_show_bill || ' cons_billing_number, ';
l_inv_sel1 := l_inv_sel1 || ' arpt_sql_func_util.get_org_trx_type_details(ps.cust_trx_type_id,ps.org_id)'
|| ' invoice_type_inv ';
IF upper(:p_mrcsobtype) = 'R' then
l_inv_sel1 := l_inv_sel1 ||
' from hz_cust_accounts cust_acct,
hz_parties party, ';
/*Bug 3487101 : Incorporated the logic of COMP_AMT_DUE_REM_INVFORMULA() in the main query itself */
l_inv_sel1 := l_inv_sel1 ||
'(select a.customer_id,
a.customer_site_use_id ,
a.customer_trx_id,
a.payment_schedule_id,
a.class ,
sum(a.primary_salesrep_id) primary_salesrep_id,
a.due_date ,
sum(a.amount_due_remaining) amt_due_remaining_inv,
a.trx_number,
a.amount_adjusted,
a.amount_applied ,
a.amount_credited ,
a.amount_adjusted_pending,
a.gl_date ,
          a.trx_date ,
Where do i have to add to two fields?
Regards,
thijs

This code is not formatted and therefore very hard to read. Please use the <pre></pre> tags to format code.
Error: ORA-01789: query block has incorrect number of result columns
Cause: You tried to execute a SELECT statement (probably a UNION or a UNION ALL), and all of the queries did not contain the same number of result columns.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Want to add field in standard table control - me21n , me22n , me23n

    Dear All ,
    I have come across a situation where I want to add a field in a standard table control .
    But how to proceed for tht I am not getting .
    In the standad transation me22n in the ITEM  OVERVIEW table control I want to add Curreny field in the table control structure
    i.e MEPO1211 I have append the field in MEPO1211_DATA it is even visible in run time in the structure but not visible in table control and in table control settings also.
    How can I add one more column or some standard procedure to do that. Please suggest .
    Thanks & Regards
    Aryan

    hi,
    If you don't want to access key...then only option is ,you have to search USER Exit or BADi (Try using BADI ME_GUI_PO_CUST) for me22n transaction......to adding the field.
    Regards
    Gaurav

  • Add fields to report

    Dear ,
    I Want to develop a new report but i'm new in oracle finance and I don't know where can I get the REFRENCE NUMBER Field and the TRANSFER TO GL Field.
    Thanks in advance.
    Yara Soulayman.

    I didnt get ur question clearly by 'Transfer to GL' Field..
    Talk to the users or functional people and find out Apps Screens on which the reports are based on, for e.g, if you need to create a report on all journals posted during the day, ask the user which is the screen he uses to view the Journals. Once you know that, go to Help->Diagnotics->a screen will appear asking for password('Enable Diagnotics Screen', contact Admin if u dont know password)
    Enter Block: SYSTEM
    Fields:last_query
    Also refer eTRM for GL
    Alo visit:
    http://download-east.oracle.com/docs/cd/B11454_01/11.5.9/html/erpdoc.html
    http://www.oracle.com/applications/financials/index.html?catalog.html
    There is some documentation on GL 11i on Appsnet
    Url is : http://www.oracle.com/appsnet/products/financials/docs/general_ledger.html
    Cheers!!
    [email protected]

  • Add fields to report ME55

    Hello,
    I need to add some fields in reports from transaction ME55
    Can anyone give some details to solve this
    Thanks

    Hello,
    I´ve check program  RM06BF00  but i don´t see any point in this program to add fields.
    i´ve debug  RM06BF00 program, it select all data but it display data using this perform:
    "PERFORM submit(sapfm06b) USING sucomm."
    any idea?

  • Want to add Field for movement type 501

    Dear Expert,
    Hi..
    i am working on Goods Receipt without PO ( Mvt 501 ). here for this business wants to add the value of the material at the time of Good Receipt. business also wants to make this field required field. so pl. guide me on this.
    Thanks a lot
    H Shah

    Hi,
    if i understood your question correctly
    There is one setting of creating purchase order at the time of GR, for this you have to maintain info records and activate setting in SPRO of create PO at the GR, Then your problem will get solved, Gr becomes valuated and PO will be created in background.
    Putting value at GR does not make any. sence
    Thanks
    Kedar

  • Add fields to reporting table/structure CCSS

    My customer has defined some new fields (Z......) for WBS reporting in table PRPS. They would like to use these fields in report painter reports, but we have not managed to make them available in the library used (6P3). In order to make that happen they must show in the reporting table/structure used (CCSS) I guess? According to SAP there's no "easy way" of doing this, but obviously it should be possible.
    Can somebody give ma an idea how this can be done?

    Eventually we manage to get the customer defined field to show up as a characteristic in the relevant library. The reason we struggled with this was the defined length of the field. SAP does not accept a characteristic with a defined field length of more than 24 characters (we had 30). We ended up redefining the length of the field directly in include CI_CC1Z.
    Edited by: Roar Sørli on Feb 5, 2009 2:52 PM

  • Add field in report Z_ALR_87011963

    hi everybody
    I have to add a field on the selection screen of report Z_ALR_87011963, the field anlz-pernr
    I have made a copy of RABEST_ALV01 but I cant detect where the selection screen is getting populated
    I have added the field in structure CI_REPRAZUGA but apparently this structure i used for output
    does anybody know how to add a field on the selection screen
    thanks for your help

    Hi,
    While copying the standard code
    check all the check boxes in the first screen.
    In the next screen copy all the standard includes to Z includes.
    RASORT14
    RASORT_ALV04
    RASORT_ALV08
    RASORT_ALV10
    RASORT_ALV_DATA_FIELDCAT
    RASORT_ALV_MISC
    RASORT_ALV_PREPARE_TABLE
    RASORT_ALV_TOOLS
    ZRASORT14
    ZRASORT_ALV04
    ZRASORT_ALV08
    ZRASORT_ALV10
    ZRASORT_ALV_DATA_FIELDCAT
    ZRASORT_ALV_MISC
    ZRASORT_ALV_PREPARE_TABLE
    ZRASORT_ALV_TOOLS
    Now the complete prog is with you.
    In the starting lines of prog the selection screen design is done you can add the required field there.
    I think this will solve your problem.
    Reward points if it is helpful......
    Kruthik

  • Intrastat - Add fields in report output - VE01

    Hi Friends,
    I do not see import output  fields like mode of transport, COO, material No, etc in VE01 intrasta report output. Is there any configuration to add required output fileds. In the select laout also we do not have these fields except there in VEIAV table
    early respinse appreciated
    Thanks,

    Hi,
    Your question is already answered here:
    [VE01 -  User exit and BADI ?;
    This can be done through screen exit in SMOD/CMOD enhancement RVEXAKK1
    BR,
    Barna

  • We need add field to report Gen.Trip data (s_ahr_61016405)

    Hi Experts:
    In this moments we use the report s_ahr_61016405 for admin the Travel Management. But we need know if is posible include a new field whit REGION MAINT DEST in the output.
    Regards, Carlos Puga

    Hi Experts:
    In this moments we use the report s_ahr_61016405 for admin the Travel Management. But we need know if is posible include a new field whit REGION MAINT DEST in the output.
    Regards, Carlos Puga

  • Want to ADD PARAMETERS to Report

    hi guys iam new to discover tool
    rite know my task is to assign parameters (date) to the existing report
    pls put some light on this
    thank you Gurus in advance

    1. Open the report
    2. Click on the "Tools" menu, and select "Parameters"
    3. Click "New"
    4. Enter a name for the parameter
    6. Select an item on which to base the parameter (let's call it ORDER_DATE)
    7. Check the box to create a condition, then choose the operator (so if you want all orders that were entered after the date the user entered, choose >)
    8. Enter a prompt and a description
    That should be enough to create one. Once you are comfortable with that, you can play around with other things like enabling/disabling multiple values, selecting from a list (or calendar), defaulting the value, and making the parameter optional. You can also not create a condition with the operator, and create one on your own.

  • Add fields in Drilldown customer reporting open items

    Hello,
    I have made a copy of the standard Drill down report 0SAPDUEAN-01,but I want to add fields that are not in the pooll list (like Reference - BKPF-XBLNR) or Assignment (BSEG-ZUONR).
    How can I do this?
    Any help will be rewarded
    Best regards,
    Victor

    <P>Hi Austin<P>
    <P>I need to do the same. I need to bring Bill of Lading number (which is Shipment number in our case). I need to bring that to the assignment field in the gl account. I know this can be done through sort key, but the field TKNUM is not avilable for sort key. I was wondering if you have found any solution of this.<P>
    <P>Thank you<P>
    John

  • Need to add custom fields in Report RM06EN00 ( Tcode ME2N ) in the Output

    Hi,
            MY requirement is i need to add 10 custom fields in the standard program RM06EN00  whos tcode is ME2N.
    i have appended the fields in the EKKO table and they r now available in the dynamic selection screen of the report RM06EN00.
    But i need to display this fields in the output and these fields should also be available in the change layout of the ALV report which is displayed when u click on the change button after pointing the cursor on the PO number.
    I am looking out for any enhacement though which this requirement can be met. however my second option is to copy the standard report to a z program and modify it.  but i think it will not going to be east and it may take a lot of time..
    Need both advice and answers for this soon.
    Thanks in advance.
    Best Regards,
    Fardeen

    If you have want to add fields in Field catalog from se11 Add fields in this structure MEREP_OUTTAB_PURCHDOC using append structure and activate and execute ME2N with BEST_ALV IN SCOPE LIST U WILL find in change layout.

  • Add fields to the standard report QM15

    i want to add fields to the standard report.
    t.code QM15 which display the list of items: selection of notifications.
    the fields i want to add are:
    1. batch no
    2. Sample no
    3. Main vendor
    please let me know how can i do this. if any one can help me with screenshot doc. this is really helpful.
    Thanks

    Hi experts,
    I have done with the z** creation of the standard report. I also create the z*include for the standard includes which are in the standard program. But I not able to find the fieldcatlog or include where I can add my new fields.
    But I tried with one structure tht is standard structure in tht standard report so i make it as z*structure and I append my new fields to this structure. I debug the report and this works fine and also shows output, but at output when I change the layout to see these new fields it shows dump.
    Then I tried with one more thing to give the positioning to my new added fields. (This is what u can say column positioning ).
    When I execute this,it goes to dump screen.
    Now I don't what to do with this.
    If any one like to see the code. Plz let me know I will post the code.
    Or if any one have any document on this plz share. Or any other solution.
    Thanks in advance.
    Thanks
    Sachin

  • How to add an embedded report to custom UI?

    Dear colleagues:
    Since now I am doing investigation on this:How to add an embedded report to custom UI , so do you have some guideline doc for this?
    Requirement is:
    Customer want to add a custom report to a custom FS page. And it has some standard fields from contract. So do you have any ideas about this?
    Thanks & Best Regards,
    Qiang

    Hi Jens,
    Attachment is the guideline for how to add an embedded report to custom UI. However, so far as i know, there still a limitation that is about inport parameter.
    For example, now can show all data of accounts. but i just only want show one account data when click account. so you can share to us if you have any idea about it.
    Thanks &Best Regards,
    Qiang

  • Add Fields in S_ALR_87013570

    Hi All,
    I want to add fields in ALV in transaction S_ALR_87013570.
    The way i find is to copy the program but it seems very complicated because of 2 things:
    First one, there are a lot of programs to copy and if a update comes, the copy will not be updated...
    Second one, the program seems to be "mandant (system)" dependent...
    Sorry, i've checked now and the program is not System dependent... There was an "If sy-mandt <> XXX".
    I copy the first part and when i activate it, if i try tu use it in my "test mandant", an error appears and say "Program could only be used in mandant (system) XXX".
    Could somme one tell me how to use this program in other mandant (system) (i try to transfer it with scc1 but don't work)?
    And is there any other way to add fields in report S_ALR_87013570?
    Thanks
    Luis.
    PS: Please, apologize me for my english i'm a spanish boy who live in french country :o)
    Message was edited by: me :o)
            Luis Loredo

    Hi,
    I follow this good topic, but I have two questions :
    - I created me own Z* from standard 6PP2-001 and I would like add just one column but I can't ... only new section or horizontale page are available. Can you explain, a little more, the differentes steps to create column ?
    - In a second time, I'm looking for fill this new column with my own selection. User Exit with structure append on CCSS, I think is the good solution but ... I don't find place for abap customer ... any ideas ?
    By advance, Thank you.
    Ps: sorry for my english ...
    Edited by: AlexDoy on Jul 13, 2011 8:36 AM

Maybe you are looking for