Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

next sap note for sm30 dump

$
0
0

Hi Friends

 

am getting dump for  sm30

which say  ' Memory for screen Load used by bytes ) is not available ..    I  found  sap note 167229  is  solution for this

but when I downloaded this note in my system it  say ' Cannot  be Implemented '   is there any other sap note or solution

for this issue.

my system is  740 final release version .

 

also want to know if  this issue is related to basis or abap

 

regards

Kushi


FICO tables with maintenance view

$
0
0

Hello All,

 

I need to find the list of tables in FI track which have a maintenance view. Understand that,  the maintenance view list can be seen from TVDIR table.  But how to segregate the FICO specific tables under this list is the concern. Please advise.

 


Many Thanks in advance,

Jes

Tables or function modules where the check details are saved in FPCJ payment-ISU

$
0
0

Hi Experts ,

 

 

Is there any function module which gives the complete details of payment document .

 

I want the check details and the amount which are used when we have multiple contract accounts and multiple check numbers  .

 

 

 

 

 

Regards,

Subeesh Kannottil

Redesign of existing interfaces using

$
0
0

Hello experts,

 

i'm currently working on redesign of some old interfaces between our SAP system and legacy systems.

Some of these were built via RFC (remote enabled function call done by remote system).

 

The functions are in most of cases doing retrieval of data (selection of data according to parameters and fill export parameters with the results).

And most of time of common data (PO, SO, Deliveries,....).

 

 

My approach is to check if instead to the custom functions, some standard bapis could be used.

The remote system could call these bapi via RFC as today.

The bapis could need to be adapted (exits, badis,..) to fit the existing requirement.

 

The 2nd idea was to no more use RFC call but use Web services (by generating the service for the functions to be used).

 

 

For the interfaces doing data update (update, creation,....)

approach is trying to find standard bapi which could fulfill the need or standard idocs.

 

What do you think ?

Any idea, remark, is welcome

 

S.N

TRANSLATE USING not working to remove "#" from a field ?

$
0
0

Hi Experts,

 

I am trying to remove # from a field using the below statement.

 

TRANSLATE WITH_SPECIALCHAR USING SPECHARSEAR.

 

DATA: SPECHARSEAR(50) VALUE                           

     ''' _ < > ! " & / = ? : ; , . - ( ) # # % ^ $ | ~ @ '.

 

It doesn't work for the one scenario for values like #KFTIN00097198# which has # at both the ends. It works well with #KFTIN00097198 or KFTIN00097198# or #KFTIN0$0097198#. The # is not removed if it is at both the ends. Can you please help me here ?

 

This code is part of an edited version of the FM "SF_SPECIALCHAR_DELETE".

 

 

Thanks a lot in advance

Akhil

RV_CONDITION_COPY second condition supplement

$
0
0

Hello,

 

I am facing currently an issue with the RV_CONDITION_COPY function module. I use this FM to create new conditions. If I enter a single entry in the COPY_RECORDS table the condition is create correctly without a problem.

 

Now my task requries also to create a supplement condition. My assumption would be to create a second entry in the COPY_RECORDS table but if I try this there is no new supplement condition and my working first entry is now empty and has a deletion flag.

 

In my source code you see iv_kbetrc1 which is my main condition type and with only this type my condition is created correctly.


iv_kbetrc2 is now my subblement condition type. I tried simply adding a second entry in COPY_RECORDS but without any luck.

 

*--------------------------------------------------------------------*

* FIELD-SYMBOLS

*--------------------------------------------------------------------*

    FIELD-SYMBOLS: <s_records> TYPE komv.

*--------------------------------------------------------------------*

 

 

    s_pricing_keys-vkorg    = iv_vkorg.

    s_pricing_keys-vtweg    = iv_vtweg.

    s_pricing_keys-pltyp    = iv_pricel.

    s_pricing_keys-waerk    = iv_konwa.

    s_pricing_keys-matnr    = iv_material.

    s_pricing_keys-j_3asize = iv_j3akord.

 

 

    APPEND INITIAL LINE TO t_records ASSIGNING <s_records>.

    <s_records>-kappl = 'V'.

    <s_records>-stfkz = 'A'.

    <s_records>-krech = 'C'.

    <s_records>-kschl = iv_kschl1.

    <s_records>-kbetr = iv_kbetrc1.

    <s_records>-waers = iv_konwa.

    <s_records>-kpein = 1.

    <s_records>-kmein = 'ST'.

    <s_records>-zaehk_ind = '1'.

    <s_records>-kopos = '1'.

 

 

    UNASSIGN: <s_records>.

 

 

    IF iv_kschl2 IS NOT INITIAL.

 

 

      APPEND INITIAL LINE TO t_records ASSIGNING <s_records>.

*      <s_records>-

      <s_records>-kappl = 'V'.

      <s_records>-stfkz = 'A'.

      <s_records>-krech = 'C'.

      <s_records>-kschl = iv_kschl2.

      <s_records>-kbetr = iv_kbetrc2.

      <s_records>-waers = iv_konwa.

      <s_records>-kpein = 1.

      <s_records>-kmein = 'ST'.

      <s_records>-zaehk_ind = '2'.

      <s_records>-kopos = '2'.

      UNASSIGN: <s_records>.

 

 

    ENDIF.

 

 

    CALL FUNCTION 'RV_CONDITION_COPY'

      EXPORTING

        application                 = 'V'    " Application

        condition_table             = '940'    " Condition Table Number

        condition_type              = 'J3AP'    " Condition type

        date_from                   = iv_datam    " Valid-from date

*        date_to                     = '00000000'    " Valid-to Date

        enqueue                     = abap_true    " Lock indicators of condition recor

        i_komk                      = s_pricing_header    " Communication block header (pricing)

        i_komp                      = s_pricing_position    " Communication block item (pricing)

        key_fields                  = s_pricing_keys    " Key fields

        maintain_mode               = 'A'    " Mode: Create, Change, Display

        no_authority_check          = abap_true    " Do not carry out authorization check

*        no_field_check              = ' '    " Do not carry out field checks

*        selection_date              = '00000000'    " Selection date

*        keep_old_records            = abap_true    " Indicator: Old records are not deleted

*        material_m                  = material_m    " MAPOV segment (application V)

*        used_by_idoc                = abap_true    " Controls special handling in case of IDoc processing

*        i_kona                      = i_kona    " Transfer of KOMA (for IDoc processing)

        overlap_confirmed           = abap_true    " Automatic confirmation in case of overlapping periods

*        no_db_update                = ' '    " Automatic confirmation in case of overlapping periods

*        used_by_retail              = ' '    " Automatic confirmation in case of overlapping periods

*      IMPORTING

*        e_komk                      = e_komk    " Communication block header (pricing)

*        e_komp                      = e_komp    " Communication block item (pricing)

*        new_record                  = <new_record>    " New condition record was created

*        e_datab                     = e_datab    " New condition record was created

*        e_datbi                     = e_datbi    " New condition record was created

*        e_prdat                     = e_prdat    " New condition record was created

      TABLES

        copy_records                = t_records    " Table of conditions to be copied

*        copy_staffel                = copy_staffel

*        copy_recs_idoc              = copy_recs_idoc

      EXCEPTIONS

        enqueue_on_record           = 1

        invalid_application         = 2

        invalid_condition_number    = 3

        invalid_condition_type      = 4

        no_authority_ekorg          = 5

        no_authority_kschl          = 6

        no_authority_vkorg          = 7

        no_selection                = 8

        table_not_valid             = 9

        no_material_for_settlement  = 10

        no_unit_for_period_cond     = 11

        no_unit_reference_magnitude = 12

        invalid_condition_table     = 13

        OTHERS                      = 14

      .

    IF sy-subrc NE 0.

      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

    ELSE.

 

 

      CALL FUNCTION 'RV_CONDITION_SAVE'.

 

 

      CALL FUNCTION 'RV_CONDITION_RESET'.

 

 

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

        EXPORTING

          wait = abap_true.

    ENDIF.

 

 

    CLEAR: t_records.

    CLEAR: s_pricing_keys.

 

If you know a solution or another way to create those supplements condition I would be very gratefull.

 

Thank you.

 

BR,

Andreas

custom message in sales order creation

$
0
0

hi everyone i just created a information custom message in sales order creation in program MV45AFZZ location userexit_move_field_to_vbak but my message is repeating every time whenever in just entering other fields.How to restrict message only once can anybody suggest me......

BAPI parameter structure and RFC protocol

$
0
0

Let's say there is a BAPI A which has a parameter B.

B is a structure and has three fields.

I think the underlying layer would concatenate three fields into a string and transfer it on the internet.

If I change the structure like adding a field to make it four, there is nothing else needs to do, the BAPI still works.

My question is how the RFC protocol works because there seems no re-generation underlying code or something like this.


Planned costs calculation in IW33 tcode

$
0
0

Hi,

 

I want to know how does the planned cost is calculated in IW33 tcode.Is there any FM or BAPI?

 

Thanks.

Parallel Processing Issue : call function starting new task

$
0
0

Hi

 

I am using the parallel processing functionality using the call function new task  destination in group default  Performing    on end of task  inside a loop ( i am splitting the internal table )

 

 

However when i am debugging the code, i am able to see the function module( it opens a new session in debugging ) ,  and i see that new task is started after the RFC Function module is executed .

 

How is this parallel processing ? I mean the new task starts after control returns back to main program , after the execution of the RFC FM.

I thought the idea was to have the same FM executing in multi threads. So that time is saved.

Performance issue in select query

$
0
0

Hi Experts,

 

I have written one query to fetch data from SAP which is giving performance issue. Query is:

 

IF ROWCOUNT > 0.

   ROWCOUNT = ROWCOUNT + ROWSKIPS.

ENDIF.


SELECT (outdata_itab-line) FROM (fromClauseString) INTO @<datarow> BYPASSING BUFFER UP TO @ROWCOUNT ROWS WHERE (whereClauseString).

 

     CLEAR: returnRowString.

     IF SY-DBCNT GT ROWSKIPS.

     DO numberFields TIMES.

       ASSIGN component sy-index of structure <datarow> to <datafield>.

       dataFieldString = <datafield>.

       CONCATENATE returnRowString '^~^' datafieldstring INTO returnRowString.

     ENDDO.

     dataline = returnRowString.

 

           INSERT dataline INTO TABLE data.

       ENDIF.

 

 

   ENDSELECT.


Everything mentioned in select query is coming dynamically from front end. We have 2 parameters called ROWCOUNT and ROWSKIP based on which data is going to front end. Input for these 2 fields comes in loop from front end.


If condition mentioned in bold is giving issue when sy-dbcnt is more.


Please help me in finding way to escape this.


Thanks!


Akanksha



Disable change history in BP transaction

$
0
0

Hello All ,

 

  I am trying to update Business Partner details through BAPI.

Once updated the change history can be seen in BP transaction.

I want to disable it.Let me know if you have come across similar requirement.

 

Regards,

Gowtham

abap in SQ02. Sum functions.

$
0
0

Hello, i am new to abap in SQ01/SQ02 querys. I made a query which generates a list of the orders in table AUFK and looks in the billing document table VBRP to see if there is a credit amount involved in the order. I made a simple code which generates a correct result, but it takes to much time, and i cannot run the query for the amount of orders i need to look up.

 

The code i wrote is as follows:

 

select sum( netwr ) into creditamount from vbrp

Where aufnr = aufk-aufnr

And vgtyp = 'K'.

 

This code seems to work fine, but it takes to long to generate an output for the whole list for a year. Each order takes about 10 seconds to generate.

 

So then i tried to do the same, but then by using an internal table. I think this could speedup the runtime significantly.

I think i succesfully managed to create the internal table and fill it with data, but I am not sure how to pull data from the internal table into to a field I made in the infoset (fieldname = creditamount).

 

What i tried is the following:

 

 

types: begin of ty_itab,

netwr type vbrp-netwr,

vgtyp type vbrp-vgtyp,

aufnr type vbrp-aufnr,

end of ty_itab.

 

data: wa_itab type ty_itab.

 

DATA : BEGIN OF itab OCCURS 0,

netwr type vbrp-netwr,

vgtyp type vbrp-vgtyp,

aufnr type vbrp-aufnr,

END OF itab.

 

select netwr vgtyp aufnr from vbrp into itab.

endselect.

sort itab by vgtyp.

 

loop at itab into wa_itab where aufnr = aufk-aufnr.

if wa_itab-vgtyp ='k'.

sum.

write creditamount.

endif.

endloop.

 

unfortunately, this code returns nothing. Any suggestions?

 

Thanks in advance.

GR reversal issue using bapi BAPI_GOODSMVT_CANCEL

$
0
0

Hi Experts,

 

I have an issue,

 

There is a GR with material document having 2 line items for the same material number.

 

Both have different storage locations.

 

Now in my program when I am trying to reverse the GR using bapi BAPI_GOODSMVT_CANCEL, the return table displays error "Deficit of BA Unrestr. prev. 0.050 MT : CH8020203 2105 1001 AO-DPDB".

 

So please suggest me the solution for this.

 

Thanks in advance.

Sanjeev

Mail sending to multiple email id with one attachment problem

$
0
0

Hi,

 

I have developed one z* program to send attachment to multiple email id's. But, system is sending to only one email id's.

 

Please check below code and suggest what is the wrong in it.

 

loop at gt_useremail into gw_useremail.

**Convert string to xstring

       call function 'HR_KR_STRING_TO_XSTRING'

         EXPORTING

           unicode_string   = lv_data_string

         IMPORTING

           xstring_stream   = lv_xstring

         EXCEPTIONS

           invalid_codepage = 1

           invalid_string   = 2

           others           = 3.

       if sy-subrc <> 0.

         if sy-subrc = 1 .

 

         elseif sy-subrc = 2 .

           write:/ 'invalid string ' .

         endif.

       endif.

 

***Xstring to binary

       call function 'SCMS_XSTRING_TO_BINARY'

         EXPORTING

           buffer     = lv_xstring

         TABLES

           binary_tab = lit_binary_content.


**add attachment

       clear l_attsubject .

 

       l_attsubject = 'Export Sales'.

 

** Create Attachment

       try.

           lo_document->add_attachment( exporting

                                           i_attachment_type = 'XLS'

                                           i_attachment_subject =

                                           l_attsubject

                                           i_att_content_hex =

                                           lit_binary_content  ).

 

         catch CX_document_BCS into lr_docu_exc.

       endtry.

       try.

           lo_sender = cl_sapuser_bcs=>create( sy-uname ).

           lo_send_request->set_sender(

           exporting

           i_sender = lo_sender ).

 

         catch CX_SEND_REQ_BCS into lr_send_exc.

 

         catch CX_ADDRESS_BCS into lr_addr_exc.

 

       endtry.


**Set recipient

       try.

           lo_recipient = cl_cam_address_bcs=>create_internet_address(

           gw_useremail-emailid ).

 

         catch CX_ADDRESS_BCS into lr_addr_exc.

       ENDTRY.

 

       try.

 

           lo_send_request->add_recipient(

               exporting

               i_recipient = lo_recipient

               i_express = 'X' ).

 

         catch CX_SEND_REQ_BCS into lr_send_exc.

       endtry.

 

       try.

           call method lo_send_request->set_send_immediately

             EXPORTING

               i_send_immediately = 'X'.

 

         catch CX_SEND_REQ_BCS into lr_send_exc.

       endtry.

 

      try.

** Send email

           lo_send_request->send(

           exporting

           i_with_error_screen = 'X' ).

           commit work.

           if sy-subrc = 0. "mail sent successfully

             write :/ 'Mail sent successfully'.

           endif.

 

         catch CX_SEND_REQ_BCS into lr_send_exc.

 

 

       endtry.

     endloop.


Regards

Amol Khochare


How to allow users to enable/disable checkbox on the basis of authorization?

$
0
0

Hi,

 

I have a requirement wherein I do not want my users to be able to enable or disable checkbox "TEST RUN"present in standard t-code MRRL. So basically, test run will always remain checked for them and they willnot be able to change it's status.

 

How can this be achieved by creating authorization object?Can you please guide me how to do that and then how to use that authority object in my code.

 

Regards,

Chetna .

Create file on NON SAP Server From ABAP

$
0
0

Hi Folks,

 

I have requirement like to create a file on NON SAP server from ABAP.

e.g. I have Tableau server and I have to create file on Tableau server...

Is it possible....I guess in ABAP nothing is impossible...

 

 

-Amit

SAP Table Maintenance Tool

$
0
0

Please find the source code  as attached.

 

Note:

Check this document regularly for latest version source code.

________________________________________________________________________________________________________________________________________

      Whether it is a functional or technical transaction or a basis transaction, everything in SAP or for that matter in any technology, boils down to database, and as we know database means tables. Apart from the standard tables that SAP has, a business will usually have to create many 'Z' tables for its custom development. Many times a business ends up with hundreds of custom tables and always their maintenance is a real cause of concern as the usual maintenance tools in SAP have their own issues. Usually, a table in SAP can be maintained in three ways,   

 

            1.Through 'SM30' (Table Maintenance)

            2.Through SE11 

            3.Via custom transaction.


The concerns with each of this are listed below:


1. Through 'SM30' (Table Maintenance)

  • Doesn't log the changes done to a table.


  • Not so easy to restrict authorizations for a particular table for each individual user.


  • The screen is a narrow container and the user interaction is not so comfortable especially when the table has many fields or has long text fields.


  • When there are many entries to be entered in the table, there is no option to upload the entries from an Excel or CSV etc.

 

2. Through SE11

  • Doesn't log the changes done to  a table.


  • Poor security.


  • No option to upload.

 

3. Via a custom transaction

  • Requires developing a standalone program for each table which again is a problem as it ends up in hundreds of programs to maintain hundreds of tables.


  • Again, problems with maintaining authorizations for each table for an individual user.


My tool, 'SAP Table Maintenance Tool' called 'ZTMTOOL'  is a solution to all the above concerns and makes the table maintenance simple and secure. Some of the features of this tool are:


1. Security:

    Any table can be restricted or allowed for maintenance for any user just by adding an entry in a

    table ( called ZTMT_MATRIX).


2. Change History:

    All the changes (i.e., create,edit,delete) are logged into a table (called ZTMT_HISTORY).


3. Upload option:

    Records can also be created in  large numbers at once, just by uploading data as excel

    or CSV formats.


4. Look and Feel:

    All the maintenance can be done in a neat looking ALV Grid with a very easy user interaction.


5. Dynamic Selection:

    A dynamic selection screen for any table to view desired entries based on selection criteria.


6. Flexible ALV output:

    The ALV output displays the needed columns or fields as selected by the user.


7. Easy Maintenance:

    Apart from the key fields, a user can just opt to view and maintain only the needed fields.


8. Long  Text Fields:

    Simple maintenance of long text fields (> 128 characters) in a popup window with a text editor.



How to implement this tool?

  • Download the source code attached (Sourcecode.txt).


  • Goto TCode 'SE38' and create a new program 'ZTMTOOL'.

 

  • Copy and paste the code from the downloaded file 'Sourcecode.txt '.


  • Activate and run it.


  • In the initial run, the program prompts a decision popup to create; the authorizations table for this tool called 'ZTMT_MATRIX', changes log table called 'ZTMT_HISTORY' and the Tcode 'ZTMTOOL'. Program automatically creates all these objects once the user clicks on 'Approve'. If denied, the program retries and prompts again for the next  4 runs.

 

  • A user has to be authorized to maintain a particular table by maintaining an entry in the authorizations table 'ZTMT_MATRIX'. Authorizations can be maintained for each specific maintenance operation such as 'Create','Change', 'Delete', 'Upload'  by setting the relevant flag as 'Y' or 'N'. The additional flag 'FLG_CHK' in 'ZTMT_MATRIX' is to tell the program if domain/checktable validations needs to be considered. If this is set as 'N', no validations take place and one can enter any junk value into the table.

 

On how to use this tool go through the user manual below:


Untitled.jpg

   This is cover page, click on the link below to download/view complete user manual:


   ZTMTOOL Manual.pptx - Google Drive

Best Practice: Class Based Exception Handling - differentiate by Exception Text ID

$
0
0

Hi folks,

 

because I did not find a good explanation somewhere, I will just ask you for your experiences or better: Best practices:

 

Scenario: I created ABAP OO application, including a ZCL_VALIDATOR for some input checks.  I have a Exception class ZCX_VALIDATOR, which has several TextIDs for the different checks in ZCL_VALIDATOR.

 

Now, a classic SAP Dynpro should call my application, give some input

 

like:

DATA lo_validator type ref to ZCL_VALIDATOR.
try.     lo_validator->CHECK_MATNR( iv_matnr = lv_matnr )
catch EXCEPTION TYPE ZCX_VALIDATOR into DATA(lo_exc).
endtry.

 

Check_matnr does several checks and raises ZCX_VALIDATOR, but dependent on the error case, the GUI should show a 'E' or 'I'.

 

My approach would be like:

DATA lo_validator type ref to ZCL_VALIDATOR.
try.     lo_validator->CHECK_MATNR( iv_matnr = lv_matnr )
catch EXCEPTION TYPE ZCX_VALIDATOR into DATA(lo_exc).
if lo_exc->textid-msgid eq 'abc'.     MESSAGE type lo_exc DISPLAY LIKE 'I'
else.     MESSAGE type lo_exc DISPLAY LIKE 'E'.
endtry.

Question: Is there any other way to to this?

 

Thanks for your thoughts on this.

 

Greetings

michael

Sub total Issue in Smartform

$
0
0

Hello Expert,

                 

                  Can you please tell me How Calculate Subtotal in driver program & transfer in smartforms.

 

Thanks

JoyDeb

Viewing all 8332 articles
Browse latest View live


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