Wtlief value in me2n transaction

Hi all,
I tried to implement my own custom report which is similar to me2n transaction.The code which i had written is working only for certain purchase document numbers.I did not get any clue regarding this field other then this implementation.
The code or logic which i have written is as follows.
delete itab where vgabe <> 1         *considering only GR of value vgabe =1
loop at itab into watab
if watab-shkzg = 'H'.                       *deducting credit values
sum = sum  - watab-dbmtr.
elseif watab-shkzg = 'S'.                 *adding debit values
sum = sum + watab-dbmtr.
endif.
endloop.
wtlief = watab-netwr - sum.
if wtlief >= 0.
move wtlief to watb2-wtlief.   *moving to final internal table work area
endif.
I dont know where i am going wrong.suggest me if there are any changes to be made in the logic.
Thanks and regards ,
Rajesh.

Hi,
I think you did some mistake in your code.
I tried to rewrite your above mentioned code as per my understanding.
delete itab where vgabe  1         *considering only GR of value vgabe =1
loop at itab into watab
if watab-shkzg = 'H'.                       *deducting credit values
sum = sum  - watab-dbmtr.
elseif watab-shkzg = 'S'.                 *adding debit values
sum = sum + watab-dbmtr.
endif.
clear wtlief.
wtlief = watab-netwr - sum.
if wtlief >= 0.
move wtlief to watb2-wtlief.   *moving to final internal table work area
append final internal table from watb2.
endif.
endloop
Try this
BR,
Vijay

Similar Messages

  • Need help with IQ02 - using a FM do update a value in this transaction

    Hi,
    I am trying to change the Aquisition value (as in transaction  IQ02) using either of following FM:
    ITOB_SERIALNO_MODIFY_SINGLE
    SERIALNUMBER_LIST_UPDATE
    However the changed value of field (ANSWT) is not getting reflected in database.
    I tried ABAP4_COMMIT_WORK, but it didnt work.
    I also tried, BAPI_TRANSACTION_COMMIT but getting a express document message 'Update was terminated.'
    Kindly help me with this. The only thing I need to do is to change the ANSWT (Aquisition value) field.
    Thanks.
    Sanjay
    PS: Help will be rewarded

    It's a bit dangerous to use SAP function modules that are not released to the user to update SAP data because they may not be a complete LUW. IE you may have to run other FMS either before or after. Try to find a BAPI. Maybe BAPI_MATERIAL_MAINTAINDATA_RT is what you need.
    Rob

  • Where can i find Main work center field value in il03 transaction ??

    Hi experts,
    Where can i find <b>Main work center</b> field value in il03 transaction.
    Iam looking for the table from where that value will be filled.
    thanks
    Suresh

    Hi anji reddy,
    No that filed is not avaiable in that . can please tell some other soulution ...
    ASAP...
    thanks,
    Suresh

  • Badi for setting default values in the transaction in APO.

    BADI NAME: SMOD_APOCF005 which is used for setting default values in the transaction.
    I have implemented the BADI using the below code but that BADI is not triggering. Please can you provide any solution for resolving this.
    As per my requirement I am trying to set default values for these three fields RRP_TYPE, WHATBOM, CONVH.
    DATA: LS_MATLOC LIKE LINE OF IT_MATLOC.
    LOOP AT IT_MATLOC INTO LS_MATLOC.
    LS_MATLOC-RRP_TYPE = '4'.
    LS_MATLOC-WHATBOM = '5'.
    LS_MATLOC-CONVH = '999'.
    MODIFY TABLE IT_MATLOC FROM LS_MATLOC TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.
    DATA: LS_MATLOCX LIKE LINE OF IT_MATLOCX.
    LOOP AT IT_MATLOCX INTO LS_MATLOCX.
    LS_MATLOCX-RRP_TYPE = 'X'.
    LS_MATLOCX-WHATBOM = 'X'.
    LS_MATLOCX-CONVH = 'X'.
    MODIFY TABLE IT_MATLOCX FROM LS_MATLOCX TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.

    The  BADI name: SMOD_APOCF005 .
    T.code at APO : /sapapo/mat1
    Once we enter in that T.Code with some Product and Location data.
    There under PP/DS tab.
    Under Planning Procedure there is a field PP Plng Procedure which I want to set as 4
    And under Order Creation there is Plan Explosion which needs to be set as 5
    And Under Horizons there is PP/DS Horizon which needs to be set as 999.
    BADi is implemented and active.
    And once the data is CIF from ECC to APO
    These default values are not set in the T code in APO and the BADi is not triggering.

  • Passing Variant's value to a transaction iview

    Hi,
    How can I pass a Variant's value to the Transaction iView?
    Kind regards,
    Vijay

    Hi Iván,
    Thanks for your feedback.
    I have followed your suggestion(TX: /nSM35) and found the following entries while recording for 3 variants available for the transaction- please suggest me which one to use for transaction iview using RS38M-XXXXXXXX ?
    Field Name         Value
    BDC_OKCODE   /EGET
    BDC_CURSOR   PNPBEGDA
    BDC_CURSOR   04/07
    BDC_OKCODE   =PICK
    BDC_OKCODE   /EGET
    BDC_CURSOR   USERNAME
    BDC_CURSOR   05/09
    BDC_OKCODE   =PICK
    BDC_OKCODE   /EGET
    BDC_CURSOR   USERNAME
    BDC_CURSOR   06/09
    BDC_OKCODE   =PICK
    BDC_OKCODE   /EENDE
    BDC_CURSOR   USERNAME
    Kind regards,
    Vijay

  • Delete the transferred values using the transaction for changing old assets

    how to Delete the transferred values using the transaction for changing old assets.
    i want delete the my asset.
    Thank you
    Anil

    Dear Anil,
    AS06                 Delete Asset Record/Mark for Delet.
    AS26                 Mark group asset for deletion     
    Hope this will help.
    Regards,
    Naveen.

  • JDT1.MTHDATE has null value although the transaction has already closed

    Dear All
    I need to know about when is a transaction closing date
    i think i can use JDT1.MTHDATE, but sometimes i found JDT1.MTHDATE have null value, although the transaction (AR or AP) have already been closed or paid
    any body know why it could be happened ?
    thanks
    Best Regards
    JeiMing

    Hi,
    Please check Note No.  : 1179946 if the same relates to the issue reported by you.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Getting Values of MMBE transaction

    Hello all,
         I need to get the Values of the MMBE transaction and use those values in my report for calculation. Can anybody suggest a way to execute the MMBE tranasaction from my report and get the values in a  table.
    Regards,
    Vijayakumar

    Vijay,
    Submit MMBE program in your zprogram by passing the values to the MMBE selection screen for ex
    SUBMIT MMBE Program WITH p_werks = p_werks
    EXPORTING LIST TO MEMORY AND RETURN.
    and then use
    LIST_FROM_MEMORY
    LIST_TO_ASCI
    LIST_FREE_MEMORY
    Or copy MMBE program as zmmbe and then use EXPORT IMPORT concept to get the final internal table values into your zprogram.
    K.Kiran.

  • Screen Variant is not reflecting same value in different transactions.

    Hi Guys,
    I need a help, it is urgency.
    I done the screen variant for one filed is mandatory and another field in display mode (gray color) for transaction (FPR1 in ISU). After I done the screen variant the standard transaction code (FPR1) showing same result, what I am expecting.
    But the problem is, I want to maintain or enter the values from CIC front office screen.
    Once I confirm the BP and select the contract account to create install plan (FPR1), here it is open with standard view, which is not displayed with screen variant changes.
    What should i check in that case. I already checked with
    T.code : EWFC, EWBC.
    Thanks in advance. Your guidance is appreciated
    Regards,
    Venkat.

    Hi,
    Even if you group valuation/view currency is the same as controlling area currency, the system will still show the message above. SAP need you to acknowledge that you're  now costing for different valuation than your operation (legal valuation).
    Note: Normally we execute sales order costing for group valuation in the background.  You can read note 1819102 on how to remove that warning message when costing via background.
    Thanks,
    Ong Yang

  • How to set a default value to a transaction property?

    Hi All,
    I have a table in which one of the columns is production_date. I need to retrieve and display the data corresponding to the month as selected by the user in the front end. But prior to the selection, the user should see the data of the current month. I am able to show the data of the user selected month, but am unable to show the data of the current month. Instead of the current month, the transaction returns the data of the month of January by default. Can anybody help?
    Thanks and Regards,
    Lipsa.

    Jeremy,
    I am not at all bothered about the selected month. I think, you too did not get my question. Let me explain you the scenario once again.
    In the left hand side of the user's dashboard, there is a link to view current status. Once the user clicks the link, he should see two things.
    1. a chart to display the data of the current month.
    2. a drop down list to select a month of his choice.
    The data is available in the database table. This table is having a column called Production_Date. Once the user selects a month from the list, the selected item is set to an applet parameter. I have designed a BLS which calls the query template having this parameter. The QT queries for all the data from the database. The BLS is having a transaction property called 'month'. The parameter value is assigned to this property. Now, this property has the month selected by the user. Finally, I have the logic where I repeat the column Production_Date, get the month out of the date, compare the month with the property value in a conditional block, and get the data once the condition is true. Using these steps, I can get the data of the month selected by the user.
    My issue is, the user should see the data of the current month prior to selection from the drop down list which I am unable to do. Any suggestions as to how can I achieve this?
    Regards,
    Lipsa.

  • Update Attribute values of AR transaction.

    Hi All,
    We have a requirement to update the attribute of the AR transaction and have written the following code:
    DECLARE
       l_msg_count               NUMBER;
       l_msg_data                VARCHAR2 (2000);
       l_return_status           VARCHAR2 (10);
       v_batch_rec               ra_batches_all%ROWTYPE;
       v_header_rec              ra_customer_trx%ROWTYPE;
       v_errors                  arp_trx_validate.message_tbl_type;
       v_lines_tbl               ar_transaction_pub.line_tbl_type;
       v_tax_lines_tbl           ar_transaction_pub.line_tbl_type;
       v_freight_lines_tbl       ar_transaction_pub.line_tbl_type;
       v_salescredit_lines_tbl   ar_transaction_pub.salescredit_tbl_type;
       v_dist_tbl                ar_transaction_pub.dist_tbl_type;
       v_commitment_rec          arp_process_commitment.commitment_rec_type;
       v_date                    DATE;
       out_message               VARCHAR2 (4000);
       l_msg_index_out           INTEGER;
       cursor c_trx is
       select * from ra_customer_trx_all
       where customer_trx_id = 272499;--234915;
    BEGIN
       fnd_msg_pub.initialize;
       fnd_client_info.set_org_context ('328');
       fnd_global.apps_initialize (37850,50261,222, 0);
       v_date := SYSDATE - 30;--This must be a date in the open gl period
       for i in c_trx
       loop
        v_header_rec.interface_header_attribute8:= i.interface_header_attribute8;
        v_header_rec.interface_header_context:= i.interface_header_context;
        v_header_rec.default_ussgl_trx_code_context:= i.default_ussgl_trx_code_context;
        v_header_rec.interface_header_attribute10:= i.interface_header_attribute10;
        v_header_rec.interface_header_attribute11:= i.interface_header_attribute11;
        v_header_rec.interface_header_attribute12:= i.interface_header_attribute12;
        v_header_rec.interface_header_attribute13:= i.interface_header_attribute13;
        v_header_rec.interface_header_attribute14:= i.interface_header_attribute14;
        v_header_rec.interface_header_attribute15:= i.interface_header_attribute15;
        v_header_rec.interface_header_attribute9:= i.interface_header_attribute9;
        v_header_rec.default_ussgl_transaction_code:= i.default_ussgl_transaction_code;
        v_header_rec.recurred_from_trx_number:= i.recurred_from_trx_number;
        v_header_rec.attribute11:= i.attribute11;
        v_header_rec.attribute12:= i.attribute12;
        v_header_rec.attribute13:= i.attribute13;
        v_header_rec.attribute14:= i.attribute14;
        v_header_rec.attribute15:= i.attribute15;
        v_header_rec.interface_header_attribute1:= i.interface_header_attribute1;
        v_header_rec.interface_header_attribute2:= i.interface_header_attribute2;
        v_header_rec.interface_header_attribute3:= i.interface_header_attribute3;
        v_header_rec.interface_header_attribute4:= i.interface_header_attribute4;
        v_header_rec.interface_header_attribute5:= i.interface_header_attribute5;
        v_header_rec.interface_header_attribute6:= i.interface_header_attribute6;
        v_header_rec.attribute_category:= i.attribute_category;
        v_header_rec.attribute1:= i.attribute1;
        v_header_rec.attribute2:= 'NEW';
        v_header_rec.attribute3:= i.attribute3;
        v_header_rec.attribute4:= i.attribute4;
        v_header_rec.attribute5:= i.attribute5;
        v_header_rec.attribute6:= i.attribute6;
        v_header_rec.attribute7:= i.attribute7;
        v_header_rec.attribute8:= i.attribute8;
        v_header_rec.attribute9:= i.attribute9;
        v_header_rec.attribute10:= i.attribute10;
        v_header_rec.customer_trx_id:= i.customer_trx_id;
        v_header_rec.trx_number:= i.trx_number;
        v_header_rec.paying_site_use_id:= i.paying_site_use_id;
        v_header_rec.bill_to_customer_id:= i.bill_to_customer_id;
        v_header_rec.cust_trx_type_id:= i.cust_trx_type_id;
        v_header_rec.reversed_cash_receipt_id:= i.reversed_cash_receipt_id;
        v_header_rec.agreement_id:= i.agreement_id;
        v_header_rec.batch_id:= i.batch_id;
        v_header_rec.status_trx:= i.status_trx;
        v_header_rec.doc_sequence_id:= i.doc_sequence_id;
        v_header_rec.doc_sequence_value:= i.doc_sequence_value;
        v_header_rec.paying_customer_id:= i.paying_customer_id;
        v_header_rec.related_batch_source_id:= i.related_batch_source_id;
        v_header_rec.default_tax_exempt_flag:= i.default_tax_exempt_flag;
        v_header_rec.created_from:= i.created_from;
        v_header_rec.org_id:= i.org_id;
        v_header_rec.request_id:= i.request_id;
        v_header_rec.program_application_id:= i.program_application_id;
        v_header_rec.program_id:= i.program_id;
        v_header_rec.program_update_date:= i.program_update_date;
        v_header_rec.finance_charges:= i.finance_charges;
        v_header_rec.complete_flag:= i.complete_flag;
        v_header_rec.posting_control_id:= i.posting_control_id;
        v_header_rec.bill_to_address_id:= i.bill_to_address_id;
        v_header_rec.ra_post_loop_number:= i.ra_post_loop_number;
        v_header_rec.ship_to_address_id:= i.ship_to_address_id;
        v_header_rec.credit_method_for_rules:= i.credit_method_for_rules;
        v_header_rec.credit_method_for_installments:= i.credit_method_for_installments;
        v_header_rec.receipt_method_id:= i.receipt_method_id;
        v_header_rec.related_customer_trx_id:= i.related_customer_trx_id;
        v_header_rec.invoicing_rule_id:= i.invoicing_rule_id;
        v_header_rec.ship_via:= i.ship_via;
        v_header_rec.ship_date_actual:= i.ship_date_actual;
        v_header_rec.waybill_number:= i.waybill_number;
        v_header_rec.fob_point:= i.fob_point;
        v_header_rec.customer_bank_account_id:= i.customer_bank_account_id;
    --    v_header_rec.printing_option:= i.printing_option;
        v_header_rec.printing_count:= i.printing_count;
        v_header_rec.printing_pending:= i.printing_pending;
        v_header_rec.purchase_order:= i.purchase_order;
        v_header_rec.purchase_order_revision:= i.purchase_order_revision;
        v_header_rec.purchase_order_date:= i.purchase_order_date;
        v_header_rec.customer_reference:= i.customer_reference;
        v_header_rec.customer_reference_date:= i.customer_reference_date;
        v_header_rec.comments:= i.comments;
        v_header_rec.internal_notes:= i.internal_notes;
        v_header_rec.exchange_rate_type:= i.exchange_rate_type;
        v_header_rec.exchange_date:= i.exchange_date;
        v_header_rec.exchange_rate:= i.exchange_rate;
        v_header_rec.territory_id:= i.territory_id;
        v_header_rec.invoice_currency_code:= i.invoice_currency_code;
        v_header_rec.initial_customer_trx_id:= i.initial_customer_trx_id;
        v_header_rec.end_date_commitment:= i.end_date_commitment;
        v_header_rec.start_date_commitment:= i.start_date_commitment;
        v_header_rec.last_printed_sequence_num:= i.last_printed_sequence_num;
        v_header_rec.orig_system_batch_name:= i.orig_system_batch_name;
        v_header_rec.post_request_id:= i.post_request_id;
        v_header_rec.last_update_date:= i.last_update_date;
        v_header_rec.last_updated_by:= i.last_updated_by;
        v_header_rec.creation_date:= i.creation_date;
        v_header_rec.created_by:= i.created_by;
        v_header_rec.last_update_login:= i.last_update_login;
        v_header_rec.trx_date:= i.trx_date;
        v_header_rec.set_of_books_id:= i.set_of_books_id;
        v_header_rec.bill_to_contact_id:= i.bill_to_contact_id;
        v_header_rec.batch_source_id:= i.batch_source_id;
        v_header_rec.reason_code:= i.reason_code;
        v_header_rec.sold_to_customer_id:= i.sold_to_customer_id;
        v_header_rec.sold_to_contact_id:= i.sold_to_contact_id;
        v_header_rec.sold_to_site_use_id:= i.sold_to_site_use_id;
        v_header_rec.bill_to_site_use_id:= i.bill_to_site_use_id;
        v_header_rec.ship_to_customer_id:= i.ship_to_customer_id;
        v_header_rec.ship_to_contact_id:= i.ship_to_contact_id;
        v_header_rec.ship_to_site_use_id:= i.ship_to_site_use_id;
        v_header_rec.shipment_id:= i.shipment_id;
        v_header_rec.remit_to_address_id:= i.remit_to_address_id;
        v_header_rec.term_id:= i.term_id;
        v_header_rec.term_due_date:= i.term_due_date;
        v_header_rec.previous_customer_trx_id:= i.previous_customer_trx_id;
        v_header_rec.primary_salesrep_id:= i.primary_salesrep_id;
        v_header_rec.printing_original_date:= i.printing_original_date;
        v_header_rec.printing_last_printed:= i.printing_last_printed;
        v_header_rec.global_attribute1:= i.global_attribute1;
        v_header_rec.global_attribute2:= i.global_attribute2;
        v_header_rec.global_attribute3:= i.global_attribute3;
        v_header_rec.global_attribute4:= i.global_attribute4;
        v_header_rec.global_attribute5:= i.global_attribute5;
        v_header_rec.global_attribute6:= i.global_attribute6;
        v_header_rec.global_attribute7:= i.global_attribute7;
        v_header_rec.global_attribute8:= i.global_attribute8;
        v_header_rec.global_attribute9:= i.global_attribute9;
        v_header_rec.global_attribute10:= i.global_attribute10;
        v_header_rec.global_attribute11:= i.global_attribute11;
        v_header_rec.global_attribute12:= i.global_attribute12;
        v_header_rec.global_attribute13:= i.global_attribute13;
        v_header_rec.global_attribute14:= i.global_attribute14;
        v_header_rec.global_attribute15:= i.global_attribute15;
        v_header_rec.global_attribute16:= i.global_attribute16;
        v_header_rec.global_attribute17:= i.global_attribute17;
        v_header_rec.global_attribute18:= i.global_attribute18;
        v_header_rec.global_attribute19:= i.global_attribute19;
        v_header_rec.global_attribute20:= i.global_attribute20;
        v_header_rec.global_attribute_category:= i.global_attribute_category;
        v_header_rec.wh_update_date:= i.wh_update_date;
        v_header_rec.edi_processed_flag:= i.edi_processed_flag;
        v_header_rec.edi_processed_status:= i.edi_processed_status;
        v_header_rec.global_attribute21:= i.global_attribute21;
        v_header_rec.global_attribute22:= i.global_attribute22;
        v_header_rec.global_attribute23:= i.global_attribute23;
        v_header_rec.global_attribute24:= i.global_attribute24;
        v_header_rec.global_attribute25:= i.global_attribute25;
        v_header_rec.global_attribute26:= i.global_attribute26;
        v_header_rec.global_attribute27:= i.global_attribute27;
        v_header_rec.global_attribute28:= i.global_attribute28;
        v_header_rec.global_attribute29:= i.global_attribute29;
        v_header_rec.global_attribute30:= i.global_attribute30;
        v_header_rec.payment_server_order_num:= i.payment_server_order_num;
        v_header_rec.approval_code:= i.approval_code;
        v_header_rec.address_verification_code:= i.address_verification_code;
        v_header_rec.old_trx_number:= i.old_trx_number;
        v_header_rec.br_amount:= i.br_amount;
        v_header_rec.br_unpaid_flag:= i.br_unpaid_flag;
        v_header_rec.br_on_hold_flag:= i.br_on_hold_flag;
        v_header_rec.drawee_id:= i.drawee_id;
        v_header_rec.drawee_contact_id:= i.drawee_contact_id;
        v_header_rec.drawee_site_use_id:= i.drawee_site_use_id;
        v_header_rec.drawee_bank_account_id:= i.drawee_bank_account_id;
        v_header_rec.remittance_bank_account_id:= i.remittance_bank_account_id;
        v_header_rec.override_remit_account_flag:= i.override_remit_account_flag;
        v_header_rec.special_instructions:= i.special_instructions;
        v_header_rec.remittance_batch_id:= i.remittance_batch_id;
        v_header_rec.prepayment_flag:= i.prepayment_flag;
        v_header_rec.ct_reference:= i.ct_reference;
        v_header_rec.contract_id:= i.contract_id;
        v_header_rec.bill_template_id:= i.bill_template_id;
        v_header_rec.cc_error_flag:= i.cc_error_flag;
        v_header_rec.cc_error_code:= i.cc_error_code;
        v_header_rec.cc_error_text:= i.cc_error_text;
       dbms_output.put_line(v_header_rec.term_id);
       end loop;
       ar_transaction_pub.update_transaction
                             (p_api_name                   => 'AR_TRANSACTION_PUB',
                              p_api_version                => 1.0,
                              p_init_msg_list              => fnd_api.g_true,
                              p_commit                     => fnd_api.g_true,
                              p_validation_level           => fnd_api.g_valid_level_full,
                              p_batch_rec                  => v_batch_rec,
                              p_header_rec                 => v_header_rec,
                              p_receivable_gl_date         => v_date,
                              p_commitment_rec             => v_commitment_rec,
                              p_lines_tbl                  => v_lines_tbl,
                              p_tax_lines_tbl              => v_tax_lines_tbl,
                              p_freight_lines_tbl          => v_freight_lines_tbl,
                              p_salescredit_lines_tbl      => v_salescredit_lines_tbl,
                              p_dist_tbl                   => v_dist_tbl,
                              p_return_status              => l_return_status,
                              p_msg_count                  => l_msg_count,
                              p_msg_data                   => l_msg_data,
                              p_errors                     => v_errors,
                              p_recalc_tax_flag            => fnd_api.g_true,
                              p_rerun_autoacc_flag         => fnd_api.g_true,
                              p_backout_sc_flag            => fnd_api.g_true,
                              p_backout_dist_flag          => fnd_api.g_true
       IF (fnd_msg_pub.count_msg > 0)
       THEN
          FOR i IN 1 .. fnd_msg_pub.count_msg
          LOOP
             fnd_msg_pub.get (p_msg_index          => i,
                              p_encoded            => 'F',
                              p_data               => out_message,
                              p_msg_index_out      => l_msg_index_out
             DBMS_OUTPUT.put_line ('l_msg_data :' || out_message);
          END LOOP;
       END IF;
    END;However getting the below error:
    l_msg_data :Invalid payment terms id. (TERM_ID: &INVALID_VALUE)
    l_msg_data :Invalid Transaction Status &INVALID_VALUE .
    l_msg_data :Validation error(s) occurred. Rolling back and setting status to ERROR
    This was working fine sometimes back. Can anyone point the right direction. I am able to update the attribute value fron the front end.
    Thanks,
    Subhasish

    Hi All,
    Any thoughts on this ??
    Regards,
    Subhasish

  • ABAP runtime error in ME2N Transaction

    Hi All,
    I am getting an ABAP runtime error when i run transaction ME2N and then click on th Account Assignment Button.
    This is the error i get.
    Runtime Errors         GETWA_NOT_ASSIGNED
    Date and Time          06/01/2009 16:35:59
    Short text
    Field symbol has not yet been assigned.
    The section of the code which is creating problem is
    2326|*... ... find the row that holds the first requested cell                                   |
    2327
    loop at ct_stin assigning <ls_stin>
    2328
    where start_indx le i_start.
    2329
    l_start = sy-tabix.
    2330
    endloop.                       "Y6DK065306
    >>>>>
    if <ls_stin>-filled eq abap_false.
    2332
    lt_delete_row-low    = <ls_stin>-row_pos.
    2333
    lt_delete_row-sign   = 'I'.
    2334
    lt_delete_row-option = 'EQ'.
    2335
    insert lt_delete_row into table lt_delete_row.
    2336
    endif.
    | 2337|         
    the internal table ct_stin is not gettin any data in Runtime.
    Can anybody help me out in analysing this.
    Saurabh

    As I understand you have modify the standard SAP program. The problem is when the internal table
    ct_stin does not have data the field symbol <ls_stin> does not have any assign. to correct this 
    LOOPAT CT_STIN ASSIGNING <LS_STIN>
    WHERE START_INDX LE I_START.
      L_START = SY-TABIX.
    ENDLOOP.                                                    "Y6DK065306
    Check <LS_STIN> IS Assigned.
    IF <LS_STIN>-FILLED EQ ABAP_FALSE.
      LT_DELETE_ROW-LOW = <LS_STIN>-ROW_POS.
      LT_DELETE_ROW-SIGN = 'I'.
      LT_DELETE_ROW-OPTION = 'EQ'.
      INSERT LT_DELETE_ROW INTO TABLE LT_DELETE_ROW.
    ENDIF.

  • Escaping field value in custom transaction

    I have created a custom transaction inserting fields in a table called `billing`. The values are taken mainly from two other tables called `account` and `paypalinfo`. I have attached the code below.
    Please not the values to be inserted notated in wavy brackets like{paypalinfo.txnid}. This means the variable content is replacing what is in between the brackets and the brackets themselves of course at run time. Sine these are often character strings, I have put them into single quotes.
    This worked great until I had an Irish guy acccessing my site with the sirname of O'Hara. That of course confused the statement, as suddenly there was a ' character, which was supposed to be interpreted as string, but was interpreted as SQL field delimiter and thus broke the code.
    Here is my question: Should I escape the value and how would I do it, since this is not a normal code but a placeholder replaced at runtime? Or should I use another SQL field value delimiter, thus replace ' with ` ? I think the latter solution is inferior - just think of what heappens if you get an O`Hara instead of an O'Hara.
    So in essence the question is: How do you handle escaping varabiable content in custom transactions with run time replaced variables in {...} brackets?
    Any feedback welcome.
    Here is the code:
    // Make a custom transaction instance
    $customTransaction2 = new tNG_custom($conn_chilli);
    $tNGs->addTransaction($customTransaction2);
    // Register triggers
    $customTransaction2->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    // Set custom transaction SQL
    $customTransaction2->setSQL("INSERT INTO billing (buyer_email, account, affiliate, partner, admin, transid, transdate, buyer_fname, buyer_lname, package, minutesbought, amountpaid, currency, userid, mac, nasid, routermac) values ('{paypalinfo.buyer_email}','{paypalinfo.account}','{account.affiliate}', '{account.partner}', '{account.admin}', '{paypalinfo.txnid}', '".$right_now."', '{paypalinfo.firstname}', '{paypalinfo.lastname}', '{paypalinfo.itemname}', '{package.tavail}', '{paypalinfo.mc_gross}', '{paypalinfo.mc_currency}', '{SESSION.id}', '{paypalinfo.usermac}', '".$router_name."', '{paypalinfo.routermac}')");

    You should never be using anything but:<br /><br />'b string mysql_real_escape_string  ( string $unescaped_string  [, resource $link_identifier  ] )<br /><br />'i http://www.php.net/manual/en/function.mysql-real-escape-string.php<br /><br />The reasons for this is that this are related to SQL injection attacks.  I would hand code this, but for anything more complex than CRUD ( http://en.wikipedia.org/wiki/Create,_read,_update_and_delete ) (which ADDT handles very nicely) I favor hand coding as it is faster, less complex when enforcing business process.  Also, this allows one usage of the database management system's transaction mechanisms which are typically far more robust and reliable on top of being simpler to work with.  <br /><br />Please note that the type of my storage for your database within MySQL will support different features.  To enable the usage of database transactions you will need to use the InnoDB table type rather then the default MyISAM table type.  Various versions of MySQL have other options for transaction safe table but those two are the ones that are consistently available in web environs where bleeding edge software is not normally deployed.<br /><br />http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html<br /><br />Diatribe aside, what you need to do with these templated objects is to duplicate the object referenced {paypalinfo} and apply mysql_real_escape_string to the duplicates elements {paypalinfo_escaped_copy.txnid}.  Then run the copied ADDT code with values from {paypalinfo_escaped_copy}.  How you do you this I leave you to track down as I do not find that level of abstraction to be a good use of my time and other other libraries/frameworks do it much more elegantly using less of my time.<br /><br />But as Gunter already noted, refactoring your problem to work with your tools existing architectures can be simpler.  ADDT has a limited programming architecture (primary design) which is done to simplify the automatic generation of code.  This can make some simple things complex (50-80 mouse clicks) as opposed to  typing one or two lines of code.<br /><br />some thoughts, <smile><br /><br />Sean

  • How to populate default values in standard transactions

    Hi abapers,
                    what r the different ways to populate fields with default values while entering into standard transactions
    thanks in advance.

    Hi,
    You can either create trasaction variants with Default values and then create transaction suing these Variant transaction and use this transaction instead of irignal transaction.
    SHDS-> to create Variant transaction
    SE93-> to create transaction of this Variant Transaction.
    or you can also use SAP memory statements like GET and SET PARAMETERS to set one value in one internal session and get that in another session in an External session.
    Regards,
    Sesh

  • Problem in passing selection screen values using CALL TRANSACTION.

    Hi All
    I am facing problem in transfering selection screen values to the called transaction. I am trying to pass the path of the transaction filer but to no avail. The variable for filepath is not empty.
    Below is my code:
    DATA: lt_bdcdata TYPE TABLE OF bdcdata,
           wa_bdcdata TYPE bdcdata,
           opt TYPE ctu_params.
    CLEAR wa_bdcdata.
    wa_bdcdata-program  = 'RFBASM00'.
    wa_bdcdata-dynpro   = '1000'.
    wa_bdcdata-dynbegin = 'X'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_CURSOR'.
    wa_bdcdata-fval = 'RFPDO1-FEBUMSF'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'RFPDO1-FEBUMSF'.
    wa_bdcdata-fval = gv_filepath.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_OKCODE'.
    wa_bdcdata-fval = 'PASS'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    opt-dismode = 'E'.
    opt-updmode = 'S'.
    CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
    Please help.
    Harsh

    Hi Harsh,
    I think you have entered wrong main program for tcode 'FF_5' and wrong screen field for the file name. Use the below code instead of yours.
    DATA: lt_bdcdata TYPE TABLE OF bdcdata,
           wa_bdcdata TYPE bdcdata,
           opt TYPE ctu_params,
           gv_filepath type char128 value 'C:\testfile.txt'.
    CLEAR wa_bdcdata.
    wa_bdcdata-program  = 'RFEBKA00'.
    wa_bdcdata-dynpro   = '1000'.
    wa_bdcdata-dynbegin = 'X'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_CURSOR'.
    wa_bdcdata-fval = 'UMSFILE'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'UMSFILE'.
    wa_bdcdata-fval = gv_filepath.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    *wa_bdcdata-fnam = 'BDC_OKCODE'.
    *wa_bdcdata-fval = 'PASS'.
    *APPEND wa_bdcdata TO lt_bdcdata.
    *CLEAR wa_bdcdata.
    opt-dismode = 'A'.
    opt-updmode = 'S'.
    CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
    Thanks.
    Regards,
    Jey

Maybe you are looking for

  • Calculation of Housing Allowance Tax Relief

    Dear gurus, Please help me on this. The limit for housing allowance for tax relief is 150,000curr p.a. Some employees annual housing allowance is not up to 150,000curr and should be limited to that amount when running payroll. They have same employee

  • How to display a Hierarchy node for level 2 without parent and description

    Hi, How to display a node at level two at the query the first node is CLASS where hierarchy is maintained and the second node is subclass where hierarchy is not maintained, Now I want to display the subclass in the row where it has to display its chi

  • IPhoto 6 does not display correct Spotlight results

    I am new to OS X, and I have not to my knowledge altered any of the default Spotlight/iPhoto options. I have a large photo library. When searching through it using spotlight, it finds exactly the results I want. However, when clicking on the result,

  • Deciding Column name in UPDATE statement at runtime?

    Hi, Assuming there are 5 columns COLUMN1 through COLUMN5 in TABLE1 In any Update Statement, say: UPDATE TABLE1 SET COLUMN1='Hi' WHERE COLUMN2='Hello'; Can we decide the COLUMN to bet set at runtime depending on some literal value? Here in this case,

  • How can i view animations that have been sent via MMS?

    I frequently receive animations from family and friends via MMS message but they display on my X10mini Pro as static images.Why is this and what can be done about it?