Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all 8768 articles
Browse latest View live

Adding Messages in Payroll Log

$
0
0

Requirement is to add message ("Cannot run payroll for 'Employee number' , Please renew the contract) If the employee's contract ends in the particular period.

 

I have created a new function using PE04 and my functional consultant added to a newly created Schema.

 

I have used the normal message using (Message "content" Type E)

 

The problem is when multiple employees are ran , the payroll exits when the first message is thrown.

 

Could some experts help me to solve this problem?

 

Thanks in advance,

Sampathkumar Gurusamy


Enhancement SLIN errors

$
0
0

Hi all,

 

I have a structure with enhancement category (deep).

 

In the function module i have called submit statement as follows:

 

submit program with p_struc = is_structure.  (where is_structure is Enhanced with Deep)

 

when i do SLIN check, it is giving warning, in the above submit statement.

 

Please suggest me how can i avoid this SLIN error. Thanks.

 

 

Regards,

Venkat

Key based Encryption/Decryption in ABAP

$
0
0

Hi Experts,

 

I have a requirement where a string needs to be encrypted based on key/pwd and later needs to decrypted with the same key/pwd in ABAP.

Below is the highlights of requirement.

 

  1. Key/pwd has to be generated and stored for encryption/decryption.
  2. String needs to be encrypted with this key/pwd in ABAP.
  3. The encrypted string needs to be decrypted with the same key/pwd in ABAP.

 

Please suggest on how to achieve this in ABAP

 

Thanks,

Vijay

How to pass Field symbols (Dynamic Table ) as exporting parameter in a Function Module

$
0
0

Hello

 

 

How to pass <lt_dyntable> in the exporting parameter in a function Module which i have created in se37.

 

I have declared <lt_dyntable> as

 

FIELD-SYMBOLS: <lt_dyntable> TYPE ANY TABLE.

Steps to include Custom program in LSMW

$
0
0

Hi Experts,

 

Created custom program to load data into Kna1 table. Customer program is having selection to select file from workstation. I would like to include this custom program into LSMW.  Insted of running this custom program from SE38, I want to run from LSMW. Please let me know the steps to include custom program in LSMW.


Need your help. Kindly suggest.

 

Thanks,

Kavya M B

Sales order Pricing

$
0
0

Hi,

 

My requirment is to add 1 condition at item level when a specific partner function is added while creating a sales order i have done neccessary coding but i am facing a problem as when I add a partner function(Item level) and switch to Condition tab the condition i have added is not getting displayed i have to click on update and select C then it is getting displayed. I want this through code.

Please suggest me ASAP.

 

Thank You

How to print text ids in smartforms from outbound deliveries

$
0
0

Hi ,

 

My requirement is to print material description in smartforms of the item details  from the text ids of outbound delivery of certain sales order no.

From the research I came to know to use READ_TEXT function module..

I checked in VL03N i found there are some texts.

My internal table in SMARTFORMS where to print these material descriptions  is IT_FINAL where i have fetched details from LIKP and MAKT previously ,but now am clueless how to print them in the Material description column if it is Line item based or else if it is in Header Print them below the Ship to or Sold to Party.

Can anyone guide me to print these into smartforms step by step...

 

Regards,

Sanjay

Modify excel that is to be downloaded using cl_gui_frontend_services=>gui_download

$
0
0

Hi,

 

I have this strange requirement wherein I have to modify the excel that is downloaded using  cl_gui_frontend_services=>gui_download. The excel that I am dowloading is more like a template, it contains only header. For one of the header columns, there can be only few acceptable values. Since, the excel is a template all the cells in that particular column should have a drop-down option that would display the acceptable values. Please help.


XML to ABAP Conversion

$
0
0

Hi, Please guide me how to transform of the below XML:-

  V112  3,000  0,0B,0D,0E,1A,1B  36 0. eSIF0. DMS: 0014-9679 V21  13. General rules at service inspection   Lockout-Tagout Start.    Preparing the wind turbine.    Pitch system B, no. 10B. - 110 ±3 bar. B:   bar   107   113     Pitch system C, no. 10C. - 110 ±3 bar. C:   bar   107   113     Note VT and serial numbers for tools used (as a comment):  Waiting for quick response. Actually the above XML has sif as a whole document in which section is in loop with attribute and a subloop of checkpoint in which two empty tag such as checkbox and textblock. Kindly guide me how i'll proceed. I'm getting error of wrong format using STRANS.

Provide BADI/Exit on screen level validation in MM41/MM42?

$
0
0

Hi,

 

My Requirement for MM41/MM42 screen level validation and components validation under the BASIC data view.

 

if MARA-MTART eq 'XXX'.

  1. to do screen level validation validation in different views(BASIC DATA, SALES, LOGISTICS DC, POS ).

  2. and also components should be maintain under basic data view level, not maintain raise error message.

elseif MARA-MTART eq 'YYY'.

  1. to do screen level validation validation in different views(BASIC DATA, SALES, LOGISTICS DC, POS ).

  2. and also components should not maintain under basic data view level, not maintain raise error message.

endif.

 

For this development i have tried with BADI_MATERIAL_CHECK/BADI_ARTCLE_REF_RT but both are not capturing screen fields data.

 

I already checked with CUSTOMER-EXITS also but that's no more useful my requirement.

 

 

Please provide any thing to validate the screen fields data in MM41/MM42.

 

Tanking you for advance.

 

Regards

Shankar B

 

ALV Tree Fieldname Problems

$
0
0

Hi there,

 

I've built an ALV Tree based on BCALV_TREE_DEMO. I've took some code and modified it for my program. The problem is the field name not shown and the parent not showing any data but the child does, like the picture shown. I wonder what happen?

alv tree.jpg

 

here is some of my code

 

**********************************************************************

**ALV Tree

**********************************************************************

***Declare Fieldcat

define m_fieldcat.

  add 1 to ls_fieldcat-col_pos.

  ls_fieldcat-fieldname   = &1.

  ls_fieldcat-scrtext_m   = &2.

  ls_fieldcat-key         = &3.

  ls_fieldcat-tabname     = 'it_merge2'.

  append ls_fieldcat to gt_fieldcat.

end-of-definition.

 

class cl_gui_column_tree definition load.

class cl_gui_cfw definition load.

 

data tree1 type ref to cl_gui_alv_tree.

 

include <icon>.

*include bcalv_toolbar_event_receiver.

include bcalv_tree_event_receiver.

 

*data: toolbar_event_receiver type ref to lcl_toolbar_event_receiver.

 

data: gt_fieldcat type lvc_t_fcat,         " Field Catalog

      ls_fieldcat type lvc_s_fcat,         " WA Field Cat.

      gt_sort     type lvc_t_sort,         " Sorting Table

      ls_sort     type lvc_s_sort,         " WA Sort Tab.

      ok_code     like sy-ucomm,           " OK-Code

      gd_layout   type slis_layout_alv.    "Layout

 

data: fl_err type c,

      d_posign type c.

 


*&---------------------------------------------------------------------*

*&      Module  STATUS_0555  OUTPUT

*&---------------------------------------------------------------------*

*       text

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

module status_0555 output.

  set pf-status 'STAT555'.

  if tree1 is initial.

    perform init_tree.

  endif.

  call method cl_gui_cfw=>flush.

endmodule.                 " STATUS_0555  OUTPUT


*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_0555  INPUT

*&---------------------------------------------------------------------*

*       text

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

module user_command_0555 input.

  clear ok_code.

 

  ok_code = sy-ucomm.

 

  case ok_code.

    when 'BACK' or 'EXIT' or 'CANC'.

      call method tree1->free.

      leave to screen 0.

    when others.

      call method cl_gui_cfw=>dispatch.

  endcase.

  clear ok_code.

endmodule.                 " USER_COMMAND_0555  INPUT


*&---------------------------------------------------------------------*

*&      Form  INIT_TREE

*&---------------------------------------------------------------------*

form init_tree .

  perform build_fieldcatalog.

 

* create container for alv-tree

  data: l_tree_container_name(30) type c,

        l_custom_container type ref to cl_gui_custom_container.

  l_tree_container_name = 'TREE1'.

 

  if sy-batch is initial.

    create object l_custom_container

        exporting

              container_name = l_tree_container_name

        exceptions

              cntl_error                  = 1

              cntl_system_error           = 2

              create_error                = 3

              lifetime_error              = 4

              lifetime_dynpro_dynpro_link = 5.

    if sy-subrc <> 0.

      message x208(00) with 'ERROR'.

    endif.

  endif.

 

* create tree control

  create object tree1

    exporting

        parent              = l_custom_container

        node_selection_mode = cl_gui_column_tree=>node_sel_mode_single

        item_selection      = 'X'

        no_html_header      = ''

        no_toolbar          = ''

    exceptions

        cntl_error                   = 1

        cntl_system_error            = 2

        create_error                 = 3

        lifetime_error               = 4

        illegal_node_selection_mode  = 5

        failed                       = 6

        illegal_column_name          = 7.

  if sy-subrc <> 0.

    message x208(00) with 'ERROR'.

  endif.

 

* create Hierarchy-header

  data l_hierarchy_header type treev_hhdr.

  perform build_hierarchy_header changing l_hierarchy_header.

 

* create info-table for html-header

  data: lt_list_commentary type slis_t_listheader.

 

  perform build_comment using lt_list_commentary.

 

* repid for saving variants

  data: ls_variant type disvariant.

  ls_variant-report = sy-repid.

 

* create hierarchy

  call method tree1->set_table_for_first_display

    exporting

      it_list_commentary = lt_list_commentary

      i_background_id    = 'ALV_BACKGROUND'

      i_save             = 'A'

      is_variant         = ls_variant

    changing

      it_outtab          = it_merge2

      it_fieldcatalog    = gt_fieldcat.

 

* create hierarchy

  perform create_hierarchy.

 

* register events

  perform register_events.

 

endform.                    " INIT_TREE


*&---------------------------------------------------------------------*

*&      Form  BUILD_FIELDCATALOG

*&---------------------------------------------------------------------*

form build_fieldcatalog .

  m_fieldcat 'VBELN' 'SO No.' 'X'.

  m_fieldcat 'VKBUR' 'S.Off' ''.

  m_fieldcat 'ERDAT' 'Created Date' ''.

  m_fieldcat 'AUART' 'Type' ''.

  m_fieldcat 'AUGRU' 'Order Reason' ''.

  m_fieldcat 'KUNNR' 'Customer' ''.

  m_fieldcat 'NAME1' 'Name' ''.

  m_fieldcat 'ZUONR' 'Reff.Faktur' ''.

  m_fieldcat 'FKDAT' 'Faktur Date' ''.

  m_fieldcat 'MATNR' 'Material' ''.

  m_fieldcat 'MAKTX' 'Description' ''.

  m_fieldcat 'DT_DNR_T' 'Tr.DNR' ''.

  m_fieldcat 'DT_PRC_T' 'Tr.Prin' ''.

  m_fieldcat 'DT_DNR_D' 'Ds.DNR' ''.

  m_fieldcat 'DT_PRC_D' 'Ds.Prin' ''.

  m_fieldcat 'DT_DNR' 'T.DNR' ''.

  m_fieldcat 'DT_PRC' 'T.Princ' ''.

  m_fieldcat 'VT_DNR' 'B.DNR' ''.

  m_fieldcat 'VT_PRC' 'B.Princ' ''.

  m_fieldcat 'VTEXT' 'Prod.Hier' ''.

  m_fieldcat 'KZWI1' 'Value' ''.

  m_fieldcat 'KWMENG' 'Qty' ''.

endform.                    " BUILD_FIELDCATALOG


*&---------------------------------------------------------------------*

*&      Form  BUILD_HIERARCHY_HEADER

*&---------------------------------------------------------------------*

form build_hierarchy_header  changing

                              p_hierarchy_header type treev_hhdr.

  p_hierarchy_header-heading = 'Hierarchy Header'.

  p_hierarchy_header-tooltip = 'This is the Hierarchy Header !'.

  p_hierarchy_header-width = 30.

  p_hierarchy_header-width_pix = ''.

endform.                    " BUILD_HIERARCHY_HEADER


*&---------------------------------------------------------------------*

*&      Form  BUILD_COMMENT

*&---------------------------------------------------------------------*

form build_comment  using pt_list_commentary type slis_t_listheader.

  data: ls_line type slis_listheader.

*

* LIST HEADING LINE: TYPE H

  clear ls_line.

  ls_line-typ  = 'H'.

  ls_line-info = 'Blocked CD-DN Document'.

  append ls_line to pt_list_commentary.

endform.                    " BUILD_COMMENT


*&---------------------------------------------------------------------*

*&      Form  CREATE_HIERARCHY

*&---------------------------------------------------------------------*

form create_hierarchy .

* add data to tree

  data: l_vbeln_key type lvc_nkey,

        l_matnr_key type lvc_nkey,

        l_last_key type lvc_nkey.

  loop at it_merge into wa_merge.

    on change of wa_merge-vbeln.

      perform add_vbeln_line using wa_merge

                                   ''

                          changing l_vbeln_key.

    endon.

 

    perform add_complete_line using  wa_merge

                                     l_vbeln_key

                            changing l_last_key.

  endloop.

 

* this method must be called to send the data to the frontend

  call method tree1->frontend_update.

endform.                    " CREATE_HIERARCHY


*&---------------------------------------------------------------------*

*&      Form  REGISTER_EVENTS

*&---------------------------------------------------------------------*

form register_events .

* define the events which will be passed to the backend

  data: lt_events type cntl_simple_events,

        l_event type cntl_simple_event.

 

* define the events which will be passed to the backend

  l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_header_click.

  append l_event to lt_events.

  l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.

  append l_event to lt_events.

 

  call method tree1->set_registered_events

    exporting

      events                    = lt_events

    exceptions

      cntl_error                = 1

      cntl_system_error         = 2

      illegal_event_combination = 3.

  if sy-subrc <> 0.

    message x208(00) with 'ERROR'.                          "#EC NOTEXT

  endif.

 

* set Handler

  data: l_event_receiver type ref to lcl_tree_event_receiver.

  create object l_event_receiver.

  set handler l_event_receiver->handle_node_ctmenu_request

                                                        for tree1.

  set handler l_event_receiver->handle_node_ctmenu_selected

                                                        for tree1.

  set handler l_event_receiver->handle_item_ctmenu_request

                                                        for tree1.

  set handler l_event_receiver->handle_item_ctmenu_selected

                                                        for tree1.

endform.                    " REGISTER_EVENTS

 

I'dont know what am I missing here, can anyone help me?

ALV

$
0
0

Hi Gurus,

 

I want to print alv in a dynamic manner, like below, field should increase dynamically. I tried  below

 

 

Input

 

Group     Text1              Field1                   Field2

25             Iron                abc                         def

25             Iron                sss                          mmm

46             Copper           Jack                        Ran

46             copper            Rob                        Jim

46             copper            Sarn                       Debr

 

Output

Group      Text1             field1                    field2                  field1      field2            field1    field2

25              Iron               abc                         def                     sss         mmm

46              Copper          jack                        ran                      rob         jim                 sarn       debr

 

I tried below method, but i dont know how to proceed. Please help.

 

LOOP AT git_output INTO gwa_output.

    READ TABLE <gfs_dyn_table> INTO <gfs_line1> WITH KEY ('PLNNR') = gwa_output-plnnr.

    IF sy-subrc = 0.

      CONTINUE.

    ENDIF.

    count = 2.

  ASSIGN COMPONENT 'PLNNR' OF STRUCTURE <gfs_line> TO <fs1>.

  <fs1> = gwa_output-plnnr.

  UNASSIGN <fs1>.

ASSIGN COMPONENT 'PLNAL' OF STRUCTURE <gfs_line> TO <fs1>.

  <fs1> = gwa_output-plnal.

  UNASSIGN <fs1>.

Endloop.

 

Then loop again same gt_output to fetch remaining column in dynamic manner,

 

  case wa_flname.

     ASSIGN COMPONENT gwa_dyn_fcat-fieldname OF STRUCTURE <gfs_line> TO <fs1>.

     ASSIGN COMPONENT  wa_flname OF STRUCTURE <gfs_line> TO <fs1>.

 

    if lv_num = 'FIELD9'."WA_FLNAME."

     <fs1> =  lv_vornr.

     UNASSIGN <fs1>.

     ELSEif lv_num = 'FIELD10'.

     <fs1> =  lv_steus.

     UNASSIGN <fs1>.

 

 

      ELSEif lv_num = 'FIELD11'.

     <fs1> =  lv_ltxa1.

     UNASSIGN <fs1>.

      ELSEif lv_num = 'FIELD12'.

 

     <fs1> =  lv_arbid.

     UNASSIGN <fs1>.

 

endloop.

 

APPEND <gfs_line> TO <gfs_dyn_table>.

CLEAR: <gfs_line>.

 

I'm new to this dynamic concept. If anyone tried like this, kindly help on. TIA.

Is it illegal to use RFC in SAP

$
0
0

Is it illegal to use RFC as tools for connecting with another (existing) application?

FYI, I am beginner to SAP. And the vendor who bought SAP to my company insist it will break the SAP support once we use RFC to connect to existing application or device. Is that true?

contract line item wise Qty need to reduce when sales order is created .......

$
0
0

Dear Frds,

 

 

I have a requirement saying that . User will create a contract with some line item....with Qty....1000

 

The same has to reduce from the contract.. ....With reference to contract i will make a sales order these qty has 500 has to reduce in my contract material against to that line item.

 

" Now in my contract it has to reduce 500 & save it to database.

 

 

 

At the time of save sales order  i tried with USEREXIT_SAVE_DOCUMENT..... It's triggering last item no. only.........Pls help me out another badi......or exits

 

 

 

Regards,

Kabil

how to update standard application log with more information.

$
0
0

Hi All,

I have a requirement where application log of transaction code - /dsd/sl_cockpit. Needs to be update with more information.

Is it possible to update the existing application log.

 

I found the Application Log Objects and sub objects used in the above T-Code.

 

If it possible to update the existing application log.

Please let me know the steps and FM to achieve it.

 

Thanks in advance.

 

Regards,

Kishan Raj


Smartforms

$
0
0

Dear experts,

                    My requirement is using weld date in header i have to fetch data,Each new date should be printed on new page.In my reports,

                    i have used loop and command.After displaying i am not getting date in my header after pressing page down key only

                    i am getting date in header.Can you explain how can i display date after display smartform.Please find attachment.

 

 

 

Regards

Samir

ASSIGN COMPONENT from a table to a dynamic table

$
0
0

every body,

     there is a very interesting thing,i didn't use before.

     in a programe,i want to transfer data from a internal table to a dynamic table,and the table tb_data may be diffrent every time,so i coded follow:

 

CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE     EXPORTING       IT_FIELDCATALOG = IT_FLDCAT     IMPORTING       EP_TABLE        = DREF.   ASSIGN DREF->* TO <GT_DYN_TABLE>.   ASSIGN COMPONENT 0 OF STRUCTURE TB_DATA[] TO <GT_DYN_TABLE>.

not used work area and assign filed one by one,the <GT_DYN_TABLE> get structure and has all data from TB_DATA.but the <GT_DYN_TABLE> is diffrent with DREF now.


ps,i don't want the table <GT_DYN_TABLE>  has the same fileds with tb_data,maybe one field more,is there any solution?

Dump of AC_SYSTEM_FLUSH MESSAGE CLASS 'CNDP' NUMBER '006'

$
0
0

My issue is when i create PO through BDC it generate the po and it allow to release from me29n.

But when after releasing when creating ses through ML81N it generate dump " MESSAGE_TYPE_X

Short text of error message:

Control Framework : Error processing control".and

 

 

I cant find the issue location.is it PO creation or SES creation.

Please suggest the solution.

SAP Persona screen Runs fine on IE but not on Chrome

$
0
0

Our users are using SAP Netweaver Portal to approve Purchase Requisition Workflows (ME54N). This screen opens up quite fine on Internet Explorer clearly showing Persona enhancements in ME54N. But when we open the same in Chrome, standard ME54N screen opens up instead of persona enhanced version.

 

Note:

1- We are accessing backend ECC workflows via UWL (Universal Work List) of SAP Netweaver Portal 7.4.

2- If we only go via SAP WebGUI, Persona enhancement works fine on both Chrome & IE. But When access the same persona screen via Netweaver Portal it works fine on IE but does not work on chrome.

BAPI_MATERIAL_SAVEDATA: MARA-KOSCH is not updated

$
0
0

Dear ABAP programmers,

 

I tried to update a dataset in table mara. To do this I want to use the BAPI BAPI_MATERIAL_SAVEDATA and BAPI_TRANSACTION_COMMIT. For testing this BAPI, I tried to update the field MARA-KOSCH. After calling BAPI_MATERIAL_SAVEDATA, the RETURN-TYPE was 'S'(Success) and after calling BAPI_TRANSACTION_COMMIT the variable SY-SUBRC was filled with 0. So I thought, BAPI_MATERIAL_SAVEDATA works fine. But when I look at the content of table mara (transaction se16n), then I can not see the updated value in field MARA-KOSCH. To check, if my user has the rights to change the contents of table mara, I tried to change the field MARA-KOSCH in transaction mm02 by using the same value for MARA-KOSCH (I used 001 as new value for MARA-KOSCH). In mm02 it works fine to change the value of field MARA-KOSCH.

I have no idea, why it does not work with BAPI_MATERIAL_SAVEDATA.

 

Can you help me, please?

Thanks a lot.

 

Stefan


My ABAP-CODE to test BAPI BAPI_MATERIAL_SAVEDATA:

 

REPORT  ZSAPN_BAPI_MATERIAL_SBO_TEST.

PARAMETERS: P_MATNR TYPE MARA-MATNR,
            P_KOSCH TYPE MARA-KOSCH.

DATA : MAT_DATA TYPE BAPIMATDOA,
      WA_HEADDATA TYPE BAPIMATHEAD,
      WA_RETURN TYPE BAPIRET2,
      WA_CLIENTDATA TYPE BAPI_MARA.

 

START-OF-SELECTION.

  WA_HEADDATA-MATERIAL = P_MATNR.

  WA_CLIENTDATA-PROD_ALLOC = P_KOSCH.


CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        HEADDATA            = WA_HEADDATA
        CLIENTDATA          = WA_CLIENTDATA

      IMPORTING
        RETURN              = WA_RETURN.

 

WRITE:/ 'Return-TYPE: ', WA_RETURN-TYPE.

 

    IF WA_RETURN-TYPE = 'E'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE:/ WA_HEADDATA-MATERIAL, 'is not updated' COLOR 3.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT = 'X'.
      IF SY-SUBRC EQ 0.
        WRITE:/ WA_HEADDATA-MATERIAL, 'is updated' COLOR 5 , 'Message: ', WA_RETURN-MESSAGE, 'MESSAGE_V1: ' , WA_RETURN-MESSAGE_V1, 'MESSAGE_V2: ' , WA_RETURN-MESSAGE_V2.
      ENDIF.
    ENDIF.

Viewing all 8768 articles
Browse latest View live


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