Giter Site home page Giter Site logo

abap's Introduction

Hi there👋, I'm Tom!

const name = 'Tom';

Developer dev = new Developer(name);

while(dev.isCoding())
{
  dev.listenToMusic();
  dev.openStackOverFlow();
  dev.drinkWater();
}

Check out my portfolio website to get to know my tech stack and some other cool stuff.

abap's People

Contributors

anuran12 avatar dependabot[bot] avatar fi-krish avatar schmelto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

abap's Issues

[Feat]: add missing method `str` + `1`

Feature request

CLASS zcl_monster DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.

    METHODS: main.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.



CLASS zcl_monster IMPLEMENTATION.
  METHOD main.
    " Local Variables
    DATA: ld_monster_number  TYPE i,
          ld_number_of_heads TYPE i.

    create_monster( id_number_of_heads = ld_number_of_heads ).

  ENDMETHOD.

ENDCLASS.

image

image

METHODS create_monster
      IMPORTING
        number_of_heads       TYPE i
      RETURNING
        value(monster_number) TYPE i.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Get values of UKM_S_ADD_INFO in Credit Management in a BP

image

DATA: lr_mo       TYPE REF TO   fsbp_memory_object,
      lt_bp3100   TYPE TABLE OF bp3100,
      ls_bp3100   LIKE LINE  OF lt_bp3100,
      ls_add_info TYPE          ukm_s_add_info.

  lr_mo ?= fsbp_memory_factory=>get_instance(
             i_partner    = p_part
             i_table_name = if_fsbp_const_xo_objects=>mo_bp3100 ).
  lr_mo->get_data_new( IMPORTING e_data_new = lt_bp3100 ).

  LOOP AT lt_bp3100 INTO ls_bp3100.
    IF ls_bp3100-addtype = '10'.
        DATA(ammount) = ls_bp3100-amnt.
    ENDIF.
  ENDLOOP.

SAP Query

  • SQVI = QuickViewer
  • SQ03 = Benutzergruppe
  • SQ02 = InfoSet
  • SQ01 = Query

[Feat]: `alt` + `shift` + `m` -> extracting a method

Feature request

CLASS zcl_monster DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.

    METHODS: main.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.

CLASS zcl_monster IMPLEMENTATION.
  METHOD main.
    "Local Variables
    DATA: monster_madness1 TYPE i,
          monster_madness2 TYPE i,
          description1     TYPE string,
          description2     TYPE string.

    monster_madness1 = 25.
    monster_madness2 = 50.

    " Derive Monster Sanity
    IF monster_madness1 LT 30.
      description1 = 'Fairly sane'.
    ELSEIF monster_madness1 GT 90.
      description1 = 'BONKERS'.
    ENDIF.
    IF monster_madness2 LT 30.
      description1 = 'Fairly sane'.
    ELSEIF monster_madness2 GT 90.
      description1 = 'BONKERS'.
    ENDIF.

  ENDMETHOD.
  
ENDCLASS.

alt + shift + m

image

image

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: remove leading zeros for WRITE statement

Feature request

New:

message = |{ delivery ALPHA = OUT }|.

Old:

CALL FUNCTION 'CONVERSTION_EXIT_ALPHA_OUTPUT'
    EXPORTING in = delivery
    IMPORTING = delivery.
" and for further processing add the leading zeros back
CALL FUNCTION 'CONVERSTION_EXIT_ALPHA_INPUT'
    EXPORTING in = delivery
    IMPORTING = delivery.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: get creditmanagement data of business partner

Feature request

Get creditmanagement data of business partner

DATA: lr_mo       TYPE REF TO   fsbp_memory_object,
      lt_bp3100   TYPE TABLE OF bp3100.

  "read BP3100 data from memory instance
  lr_mo ?= fsbp_memory_factory=>get_instance(
             i_partner    = '123456789'
             i_table_name = if_fsbp_const_xo_objects=>mo_bp3100 ).

  lr_mo->get_data_new( IMPORTING e_data_new = lt_bp3100 ).

Code of Conduct

  • I agree to follow this project's Code of Conduct

copy table lines as abap statement

image

image

VALUE #( ( CLIENT ='100' ACCOUNT_NUMBER ='00000001' BANK_CUSTOMER_ID ='0000000000100001' BANK_NAME ='Volksbank' CITY ='Gaertringen' CUKY_FIELD ='' BALANCE ='200.00 ' CURRENCY ='EUR' ACCOUNT_CATEGORY ='01' LASTCHANGEDAT ='20210922132826.0000000 '  )
 ( CLIENT ='100' ACCOUNT_NUMBER ='00000002' BANK_CUSTOMER_ID ='0000000000200002' BANK_NAME ='Sparkasse' CITY ='Schwetzingen' CUKY_FIELD ='' BALANCE ='500.00 ' CURRENCY ='EUR' ACCOUNT_CATEGORY ='02' LASTCHANGEDAT ='20210922132826.0000000 '  )
 ( CLIENT ='100' ACCOUNT_NUMBER ='00000003' BANK_CUSTOMER_ID ='0000000000200003' BANK_NAME ='Commerzbank' CITY ='Nuernberg' CUKY_FIELD ='' BALANCE ='150.00 ' CURRENCY ='EUR' ACCOUNT_CATEGORY ='02' LASTCHANGEDAT ='20210922132826.0000000 '  )
 )

Find BADIs in transaction -> `CL_EXITHANDLER`

  • Go to transaction SE80 Class CL_EXITHANDLER
  • navigate to method get_instance and set a Break-Point in the first line of cl_exithandler=>get_class_name_by_interface
  • Use the transaction in which you are BAdI-hunting
  • Examine the contents of the field exit_name whenever the processing stops at the breakpoint. I have found a case where exit_name was an unknown field. Then class_name gave a good clue to the name of the BAdI.

[Feat]: Reading from a table

Feature request

New:

lo_monster = zcl_monster_factory( lt_monsters[ monster_name = ld_monster_name]-monster_number ).

Old:

READ TABLE lt_monsters INTO ls_mosnters WITH KEY monster_name = ld_monster_name.
lo_monster = zcl_monster_factory( ls_monster-monster_number ).

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: Function `UKM_DB_UKMBP_CMS_READ`

Feature request

      CALL FUNCTION 'UKM_DB_UKMBP_CMS_READ'
        EXPORTING
          i_partner = 
          i_db_read =
        IMPORTING
          es_bp_cms = 
        EXCEPTIONS
          not_found = 1
          others    = 2.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: make str + h uppercase

What happened?

str + H Abap Source Text Search

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: SWITCH instead of CASE

Feature request

New:

DATA(day) = SWITCH char10( indicator
    WHEN 1 THEN 'Monday' (326)
    WHEN 2 THEN 'Tuesday' (327)
    " ...
    WHEN 7 THEN 'Sunday' (332)
    ELSE TROW zcx_day_problem( ) ).

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: Excel to internal Table

Feature request

* With the help of the class cl_fdt_xl_spreadsheet, XML transformations
* data can be extracted from XLSX files and converted into an internal table
TRY.
    DATA: lv_rc TYPE i.
    DATA: it_files TYPE filetable.
    DATA: lv_action TYPE i.

* Call up the FileOpen dialog
    cl_gui_frontend_services=>file_open_dialog( EXPORTING
                                                  file_filter = |xlsx (*.xlsx)\|*.xlsx\|{ cl_gui_frontend_services=>filetype_all }|
                                                CHANGING
                                                  file_table  = it_files
                                                  rc          = lv_rc
                                                  user_action = lv_action ).

    IF lv_action = cl_gui_frontend_services=>action_ok.
* when file is selected
      IF lines( it_files ) > 0.
* read first table entry
        DATA: lv_filesize TYPE w3param-cont_len.
        DATA: lv_filetype TYPE w3param-cont_type.
        DATA: it_bin_data TYPE w3mimetabtype.

* Image on appl. Upload server (binary)
        cl_gui_frontend_services=>gui_upload( EXPORTING
                                                filename   = |{ it_files[ 1 ]-filename }|
                                                filetype   = 'BIN'
                                              IMPORTING
                                                filelength = lv_filesize
                                              CHANGING
                                                data_tab   = it_bin_data ).

* solix -> xstring
        DATA(lv_bin_data) = cl_bcs_convert=>solix_to_xstring( it_solix = it_bin_data ).

* Excel (itab) -> XML -> Ref object
* Attention: memory-intensive and rel. slow! Large amounts of data should not be processed.
        DATA(o_excel) = NEW cl_fdt_xl_spreadsheet( document_name = CONV #( it_files[ 1 ]-filename )
                                                   xdocument     = lv_bin_data ).

        DATA: it_worksheet_names TYPE if_fdt_doc_spreadsheet=>t_worksheet_names.

* Determine worksheet name
        o_excel->if_fdt_doc_spreadsheet~get_worksheet_names( IMPORTING worksheet_names = it_worksheet_names ).

        IF lines( it_worksheet_names ) > 0.
* get the first worksheet and -> create REF to itab
          DATA(o_worksheet_itab) = o_excel->if_fdt_doc_spreadsheet~get_itab_from_worksheet( it_worksheet_names[ 1 ] ).

* Map reference to generic field symbol
          ASSIGN o_worksheet_itab->* TO FIELD-SYMBOL(<worksheet>).
        ENDIF.
      ENDIF.
    ENDIF.

  CATCH cx_root INTO DATA(e_text).
    MESSAGE e_text->get_text( ) TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: `alt` + `U` -> delete unused variables

Feature request

add alt + U -> delete unused variables to the eclipse shortcut list in alphabetical order

Before:

    DATA: ld_use_this  TYPE i,
          ld_also_this TYPE i,
          ld_result    TYPE i,
          ld_not_used  TYPE i,
          ld_not_used2 TYPE i,
          ld_not_used3 TYPE i.
    ld_use_this = 1.
    ld_also_this = 1.
    ld_result = ld_use_this + ld_also_this.

image

After:

    DATA: ld_use_this  TYPE i,
          ld_also_this TYPE i,
          ld_result    TYPE i.
    ld_use_this = 1.
    ld_also_this = 1.
    ld_result = ld_use_this + ld_also_this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: set additional credit management data in S/4HANA

Feature request

REPORT zfi_change_ukmbp_data.

PARAMETERS: p_partn TYPE bu_partner OBLIGATORY.

SELECT SINGLE FROM but000
  FIELDS partner,
         partner_guid
  WHERE partner = @p_partn
  INTO @DATA(ls_but000).


DATA: lr_mo       TYPE REF TO   fsbp_memory_object,
      lt_bp3100   TYPE TABLE OF bp3100,
      ls_bp3100   TYPE bp3100.

"read BP3100 data from memory instance
lr_mo ?= fsbp_memory_factory=>get_instance(
           i_partner    = ls_but000-partner
           i_table_name = if_fsbp_const_xo_objects=>mo_bp3100 ).
           
lr_mo->get_data_new( IMPORTING e_data_new = lt_bp3100 ).

ls_bp3100-mandt = '100'.
ls_bp3100-partner = ls_but000-partner.
ls_bp3100-criter = '3700'.
ls_bp3100-amnt = '1000'.
ls_bp3100-curr = 'EUR'.
ls_bp3100-addtype = '10'.
ls_bp3100-data_type = '10'.

APPEND ls_bp3100 TO lt_bp3100.

lr_mo->set_data_new( i_data_new = lt_bp3100 ).
lr_mo->validate( ).
lr_mo->save_data( ).


CALL FUNCTION 'FS_API_EXPL_SAVE'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Code of Conduct

  • I agree to follow this project's Code of Conduct

ABAP Hot Expressions

SELECT *
 FROM scarr
 WHERE carrid <> @( VALUE #( ) )
 INTO TABLE @DATA(result).

[Feat]: TYPE REF TO DATA

Feature request

New:

"VALUE is an IMPORTING parameter TYPE ANY
IF value IS SUPPLIED.
    lo_monster_log->log_value( REF#( value ) ).
ENDIF.

Old:

DATA: lo_do_calue TYPE REF TO DATA.
"VALUE is an IMPORTING parameter TYPE ANY
IF value IS SUPPLIED.
    CREATE DATA lo_do_value LIKE value.
    GET REFERENCE OF value INTO lo_do_value.
    lo_monster_log->log_value( lo_do_value ).
ENDIF.

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Feat]: cl_abap_context_info=>

Feature request

cl_abap_context_info=>

get current uname or something like this in the hana cloud version

Code of Conduct

  • I agree to follow this project's Code of Conduct

Transaction `SM04`

  1. Transaction SM04
  2. List with all sessions will open
  3. Mark the session
  4. Klick the button “end session”

Function `TH_POPUP`

    CALL FUNCTION 'TH_POPUP'
      EXPORTING
        client         = 
        user           = 
        message        = 
*        message_len    = 0
*        cut_blanks     = ' '
*      EXCEPTIONS
*        user_not_found = 1
*        others         = 2
      .
    IF SY-SUBRC <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

image

[Feat]: Method chaining

Feature request

New:

CATCH zcx_excel INTO exception.
zcl_bc_screen_message=>output( text = exeption->get_text( ) ).

Code of Conduct

  • I agree to follow this project's Code of Conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.