Quantcast
Channel: SCN: Message List - ABAP Switching, Enhancing, and Adapting Standard Programs
Viewing all 2464 articles
Browse latest View live

Re: Bringing item level custom field values into route detemination EXIT_SAPL0VRF_001

$
0
0

Hi

 

Check if subroutine USEREXIT_MOVE_FIELD_TO_VBAP in include MV45AFZZ is triggered before EXIT_SAPL0VRF_001. If it happens, your customer field should be populated.

 

I hope this helps you

 

Regards

 

Eduardo


How to limit the size of main window height according to the 15 line items?

$
0
0

Dear All,

i create table on main window on smart form , i need to make 15 item only on table on one page if more than 15 not display after 15 item but display item number 16 to 30 on next page

 

please can any one help me ?.

thanks

Re: prolem in custom report

$
0
0

hi  Klaus,

 

user and me running the report in quality environment . report show

Runtime Errors  :OBJECTS_TABLES_NOT_COMPATIBLE  for user.

Re: prolem in custom report

$
0
0

Hi,

 

if I got you, then you are runiing a report via submit and want to catch the data as decribes in the hyperlink.

 

But if you start the report yourself directly in SA38 and do some (default) layout changes, will your report work for yourself?

 

Maybe the issue is caused by different default layout settings and you will get different user denpendent result tables .

 

You can check the following:

 

Start the submitted report directly.

Change column selection and column order and safe the changed layout as user default.
Check, whether your program will still work properly..

 

Regards,

 

Klaus

Re: How to limit the size of main window height according to the 15 line items?

$
0
0

Hi

 

In your internal table, create a field for setting the page, for instance,

 

field_page = (sy-tabix + 1)  DIV 15.

 

where DIV is integer division.

 

After, in tab DATA, in where conditions

 

field_page = sysf-page.

 

I don't know if it will work, but it's an idea.

 

I hope this helps you

 

Regards

 

Eduardo

Sales Order To Delivery Restriction

$
0
0

Hi All,

 

We have a Sales Order scenario with Deal Items where the main Item say 10 and the related items say 11,12,13,14,15 always need to be delivered together. We are working in a Routine we have ensured that if only the child items are delivered, then it is errored out in that routine.

 

 

However, if only the main item say 10 is delivered and the child items are not , then it is going through to delivery where as it should not.

 

To restrict that , I had to use a select statement on VBAP in the routine . We are looking to avoid the select part as it can lead to performance issues.

 

Please suggest if FM is available or any other way, where we can have the details of child items for line item 10 by which we can determine that the Delivery should be stopped. The primary need is to avoid the select.

 

The main issue is to identify the child items when only then main is selected fro delivery.

Re: Sales Order To Delivery Restriction

$
0
0

Hi

 

In your subroutine you can access data for CVBAP and the most important, to status: CVBUP and CVBUK. Check with your SD consultant the relevant status in the last structures and maybe you will avoid access to DB. For instance, check in a debugging session field BESTA,

 

I hope this helps you

 

Regards

 

Eduardo

Re: New field in FBL5N


Re: hi is there any code for user exits in bw

$
0
0

Hi Amit,

 

Even i too seeking for the useful documents for user exits in BW.

 

Here is my Email ID: bhanuchandar.dake@gmail.com.

 

Thanks in advance. Your effort will be appreciated.

ADDING A FIELD TO THE TRANSACTION ES32

$
0
0

Hi All,

I Have a requirement where i have to add a new field to the transaction ES32 at the billing document tab. i have find a customer exit EBIA0001 which is for custom defined fields at billing document level. is it the relevant one to add the field or is there any other way.  below attached file is the screen shot in which i have mentioned where exactly i need to add the field. Please help me find the solution.

 

 

Thanks and Regards,

Mohammed Farooq

Sorting VA01 item overview's table control

$
0
0

Hi,

 

Is it possible to sort somehow the table control in VA01? Requirement is to be able to sort by item number, material number or material description.

Table control is: TCTRL_U_ERF_AUFTRAG

 

Anyone?

 

Thank you

Tamas

Runtime error in implementing a BADI.

$
0
0

Hello Experts,

                     I have requirement to incorporate certain logic by creating an implementation in BADI "workorder_update" . I have coded the logic but i get a runtime error stating that "Invalid COMMIT WORK in an update function module."   When i explored further I found that this error is arising from function module "  BAPI_MATERIAL_PLANNING " for which I have coded as below ,

 

   CALL FUNCTION 'BAPI_MATERIAL_PLANNING'
            EXPORTING
              material       = it1-matnr
              plant          = it1-werks
*            MRP_AREA       =
*            PLAN_SCENARIO  =
             MRP_PLAN_PARAM = it_mrp_list
*            MATERIAL_EVG   =
            IMPORTING
*             MRP_STATISTIC  =
              return         = t_return
*            TABLES
*              mrp_lists      = iit_mrp_list
*             EXTENSIONOUT   =
            .


*checking if  return result from BAPI_MATERIAL_PLANNING  was success.
          IF l1_return-type = 'S'.

           CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*            EXPORTING
*              WAIT          =
           IMPORTING
              RETURN        = t_return
                    .




          ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
         IMPORTING
             RETURN        = t_return
                    .

endif.

 

Thanks & regards ,

Prakrita Kapoor.

Re: Runtime error in implementing a BADI.

$
0
0

Hi Prakrita,

 

Please ask your basis team to refresh the system, since the code is from standard FM.

 

This have worked in certain cases.

 

Also try removing the badis that you have used for rollback and commit statements. This will work.

 

Thanks,

Satish

Re: Runtime error in implementing a BADI.

$
0
0

Hi Prakrita,

 

Go through the function module documentation which clearly states

 

COMMIT control

For the single- and multi-level planning, the planning results are posted by
materials. The COMMIT WORK command is executed after every planned
material.

 

This means there is no need to explicility to do another commit by

'BAPI_TRANSACTION_COMMIT'

 

So remove the commit and rollback statements.

 

Hope this helps.

 

Thanks,

Tooshar Bendale

 

Re: Runtime error in implementing a BADI.

$
0
0


Yes I agree with Tushar.

 

We can see there is in an implicit COMMIT WORK done by the system.

 

SAP Notes in the Function Module Documentation:

 

COMMIT control

For the single- and multi-level planning, the planning results are posted by materials. The COMMIT WORK command is executed after every planned material.

 

Regards,

Tanmoy


Re: How to create new Application logs in SAP by using FM BAL_LOG_CREATE.

$
0
0

Hi Kashim,

 

Please have look at the following programs -> SBAL_DEMO_01. This is a vey good example to achieve what you want. I looked it myself.

 

Regards,

Tanmoy

Re: How to create new Application logs in SAP by using FM BAL_LOG_CREATE.

$
0
0

Please do what Jochen just said.

We need to use this FM -> We can save logs in memory in the database with the function module BAL_DB_SAVE. We can save all data in memory (Importing parameter I_SAVE_ALL = 'X').

Re: How to create new Application logs in SAP by using FM BAL_LOG_CREATE.

$
0
0

Hi,

 

here is a simple Test-Report that uses the class "zvis_appl_logger" to wrap the BAL-Function-Calls for create, add message and save. Look at the implementation of the class-methods: "init", "add_messagetext", "close",

 

Regards Steffen

 

 

The Test-Report:

 

*&---------------------------------------------------------------------*
*& Report  ZSPAHR_TEST_APPLICATION_LOGGER
*&
*&---------------------------------------------------------------------*

report  zspahr_test_application_logger.

call method zvis_appl_logger=>init
   exporting
     iv_object    = 'ZSPAHR_PHV_DUNKEL'
     iv_subobject = 'ZSPAHR_PHV_BACKEND'
     iv_extnumber = 'Class.methode() / Nummer'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'A'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Abbruch'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'I'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Information'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'W'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Warnung'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'E'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Error'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'S'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Success'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = 'D'
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Debug'
     iv_add_timestamp = 'X'.

call method zvis_appl_logger=>add_message_text
   exporting
     iv_msgty         = ' '
     iv_text          = 'Dunkeltarifierung Privathaftpflicht Space'
     iv_add_timestamp = 'X'.

data ls_bapiret2 type bapiret2.
data lt_bapiret2 type bapiret2_t.

ls_bapiret2-type = 'E'.
ls_bapiret2-message = 'Fehler !'.
append ls_bapiret2 to lt_bapiret2.

ls_bapiret2-type = 'W'.
ls_bapiret2-message = 'Warnung !'.
append ls_bapiret2 to lt_bapiret2.

ls_bapiret2-type = 'S'.
ls_bapiret2-message = 'Erfolg!'.
append ls_bapiret2 to lt_bapiret2.

ls_bapiret2-type = 'I'.
ls_bapiret2-message = 'Info !'.
append ls_bapiret2 to lt_bapiret2.

call method zvis_appl_logger=>add_messages
   exporting
     it_bapiret2 = lt_bapiret2.

call method zvis_appl_logger=>close.



and the Wrapper-Class I am using for Logging:



class zvis_appl_logger definition
   public
   final
   create public .

*"* public components of class ZVIS_APPL_LOGGER
*"* do not include other source files here!!!
public section.

   class-methods init
     importing
       value(iv_object) type balobj_d
       value(iv_subobject) type balsubobj
       value(iv_extnumber) type balnrext optional
       value(iv_active) type boolean optional .
   class-methods close .
   class-methods add_message_text
     importing
       value(iv_msgty) type symsgty
       value(iv_text) type char128
       value(iv_add_timestamp) type boolean optional .
   class-methods add_messages
     importing
       value(it_bapiret2) type bapiret2_t .
   class-methods activate .
   class-methods deactivate .
   class-methods set_active
     importing
       value(iv_active) type boolean .
*"* protected components of class ZVIS_APPL_LOGGER
*"* do not include other source files here!!!
protected section.
*"* private components of class ZVIS_APPL_LOGGER
*"* do not include other source files here!!!
private section.

   class-data gv_log_handle type balloghndl .
   class-data gv_active type boolean value 'X'. "#EC NOTEXT .
endclass.



class zvis_appl_logger implementation.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>ACTIVATE
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>
method activate.

   gv_active = 'X'.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>ADD_MESSAGES
* +-------------------------------------------------------------------------------------------------+
* | [--->] IT_BAPIRET2                    TYPE        BAPIRET2_T
* +--------------------------------------------------------------------------------------</SIGNATURE>
method add_messages.

   data lr_bapiret2 type ref to bapiret2.
   data lv_text type char128.

   if gv_active = 'X' and not gv_log_handle is initial.

     loop at it_bapiret2 reference into lr_bapiret2.

       concatenate lr_bapiret2->id lr_bapiret2->number lr_bapiret2->message
         lr_bapiret2->message_v1 lr_bapiret2->message_v2 lr_bapiret2->message_v3
         lr_bapiret2->message_v4 into lv_text separated by space.

       call function 'BAL_LOG_MSG_ADD_FREE_TEXT'
         exporting
          i_log_handle = gv_log_handle
          i_msgty      = lr_bapiret2->type
*   I_PROBCLASS               = '4'
           i_text                    = lv_text
*   I_S_CONTEXT               =
*   I_S_PARAMS                =
* IMPORTING
*   E_S_MSG_HANDLE            =
*   E_MSG_WAS_LOGGED          =
*   E_MSG_WAS_DISPLAYED       =
    exceptions
      log_not_found             = 1
      msg_inconsistent          = 2
      log_is_full               = 3
      others                    = 4.
       .
       if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       endif.
     endloop.
   endif.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>ADD_MESSAGE_TEXT
* +-------------------------------------------------------------------------------------------------+
* | [--->] IV_MSGTY                       TYPE        SYMSGTY
* | [--->] IV_TEXT                        TYPE        CHAR128
* | [--->] IV_ADD_TIMESTAMP               TYPE        BOOLEAN(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method add_message_text.

   data lv_time_stamp type timestampl.
   data lv_atime(24) type c.
   data lv_tstr type string.


   if gv_active = 'X' and not gv_log_handle is initial.

     if iv_add_timestamp = 'X'.
       get time stamp field lv_time_stamp.
       write lv_time_stamp time zone sy-zonlo to lv_atime.
       concatenate lv_atime ': ' iv_text into iv_text respecting blanks.
     endif.

     call function 'BAL_LOG_MSG_ADD_FREE_TEXT'
       exporting
        i_log_handle              = gv_log_handle
         i_msgty                   = iv_msgty
*   I_PROBCLASS               = '4'
         i_text                    = iv_text
*   I_S_CONTEXT               =
*   I_S_PARAMS                =
* IMPORTING
*   E_S_MSG_HANDLE            =
*   E_MSG_WAS_LOGGED          =
*   E_MSG_WAS_DISPLAYED       =
  exceptions
    log_not_found             = 1
    msg_inconsistent          = 2
    log_is_full               = 3
    others                    = 4.

*IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
**         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
   endif.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>CLOSE
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>
method close.

   if gv_active = 'X' and not gv_log_handle is initial.

     call function 'BAL_DB_SAVE'
       exporting
         i_save_all       = 'X'
       exceptions
         log_not_found    = 1
         save_not_allowed = 2
         numbering_error  = 3
         others           = 4.

*    IF sy-subrc <> 0.
*      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*    ENDIF.

     clear gv_log_handle.
   endif.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>DEACTIVATE
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>
method deactivate.

   clear gv_active.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>INIT
* +-------------------------------------------------------------------------------------------------+
* | [--->] IV_OBJECT                      TYPE        BALOBJ_D
* | [--->] IV_SUBOBJECT                   TYPE        BALSUBOBJ
* | [--->] IV_EXTNUMBER                   TYPE        BALNREXT(optional)
* | [--->] IV_ACTIVE                      TYPE        BOOLEAN(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method init.

   data: ls_log type bal_s_log. "Log header data

   if iv_active is supplied.
     gv_active = iv_active.
   endif.

   if gv_active = 'X'.
* define some header data of this log
     ls_log-object = iv_object.
     ls_log-subobject = iv_subobject.
     ls_log-extnumber = iv_extnumber.
     ls_log-aldate = sy-datum.
     ls_log-altime = sy-uzeit.
     ls_log-aluser = sy-uname.
     ls_log-alprog = sy-repid.
     ls_log-aldate_del = sy-datum.
     ls_log-aldate_del+4(2) = ls_log-aldate_del+4(2) + 3.
     if ls_log-aldate_del+4(2) > '12'.
       ls_log-aldate_del+4(2) = ls_log-aldate_del+4(2) - 12.
       ls_log-aldate_del+0(4) = ls_log-aldate_del+0(4) + 1.
     endif.

     call function 'BAL_LOG_CREATE'
       exporting
         i_s_log                 = ls_log
       importing
         e_log_handle            = gv_log_handle
       exceptions
         log_header_inconsistent = 1
         others                  = 2.
   endif.

endmethod.


* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZVIS_APPL_LOGGER=>SET_ACTIVE
* +-------------------------------------------------------------------------------------------------+
* | [--->] IV_ACTIVE                      TYPE        BOOLEAN
* +--------------------------------------------------------------------------------------</SIGNATURE>
method set_active.

   gv_active = iv_active.

endmethod.
endclass.

Re: bapi tutorial

$
0
0
Hi

Re: Hiding the cost column in Billing document

$
0
0

Create screen variant through SHD0 for program SAPMV60A, screen 0104.

Viewing all 2464 articles
Browse latest View live


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