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

ABAP Statments

$
0
0

Hello,

 

Can any body please let me know the below statments meanings. As I am new to ABAP so I am unable to understand the syntax.

 

1.

   acgl_item-shkzg      =   *acgl_item-shkzg.
  acgl_item
-hkont      *acgl_item-hkont.
  acgl_item
-konto_txt  =   *acgl_item-konto_txt.

 

In the above statements what is the use of '*' while assigning the values.

 

2.

 

  DATA: io_edidd type ref to DATA.

 

  o_edidd = io_edidd.

 

  FIELD-SYMBOLS: <lt_edidd> TYPE tab_edidd.

 

  ASSIGN o_edidd->*TO<lt_edidd>.

 

In the anove statement, what is the use of '*' .

 

 

Kindly guide me to understand the syntax.

 

Thanks in advance.

 

Shreya


Screen Enhancement ME51N: Data not getting updated in table EBAN

$
0
0

Hi,

 

For screen enhancement of ME51N, I am using MEREQ001.

I am trying to add new tab at item level with the following fields:

1.png

I have added the fields in append structure CI_EBANDB of EBAN.

 

Logic in EXIT_SAPLMEREQ_001

 

   TABLES : ci_ebandb.

    DATA : i_mereq_item TYPE mereq_item.

 

   IF im_req_item IS INITIAL.
      CLEAR: ci_ebandb.
    ELSE.
      i_mereq_item = im_req_item->get_data( ).
      MOVE-CORRESPONDING i_mereq_item TO ci_ebandb.
    ENDIF.

 

Logic in EXIT_SAPLMEREQ_003

 

   DATA : i_mereq_item TYPE mereq_item.

 

   IF sy-tcode EQ 'ME51N'.
    IF NOT im_req_item IS INITIAL.
      i_mereq_item = im_req_item->get_data( ).

      IF ( ci_ebandb-zemail_id_pr NE i_mereq_item-zemail_id_pr OR ci_ebandb-zcon_det_pr NE i_mereq_item-zcon_det_pr ).
        i_mereq_item-zemail_id_pr = email_ip.
        MOVE-CORRESPONDING ci_ebandb TO i_mereq_item .
        CALL METHOD im_req_item->set_data( i_mereq_item ).
        ex_changed = 'X'.
      ENDIF.

    ENDIF.
  ENDIF.

 

Please guys, let me know what addition I need to do as using this logic I am not able to save the data of Email and Contact Details in table EBAN.

 

Regards,

Kush

Trigger workflow after a task under a Workbench TR is released

$
0
0

Hi,

 

I want to create a workflow which would be triggered once a task under a workbench TR is released, this task should send an email to a select few users and those users can approve or reject the workflow based on which a z table is updated with approval/rejection indicator.

 

Can you please guide me with the steps, I am new to WF's.

 

Thanks,

Karthik

ALV top of page not getting displayed

$
0
0

Hi,

following is my code and i want to display the text in top of page. The subroutinge top is not getting executed in output.

please help.

 

 

 

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

*   I_CALLBACK_PROGRAM                = ' '

*   I_CALLBACK_PF_STATUS_SET          = ' '

*   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'

   I_CALLBACK_TOP_OF_PAGE            = 'TOP'

*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '

*   I_CALLBACK_HTML_END_OF_LIST       = ' '

*   I_STRUCTURE_NAME                  =

*   I_BACKGROUND_ID                   = ' '

   i_grid_title                      'Breakdown Report for MEQ Maintenance'

*   I_GRID_SETTINGS                   =

   is_layout                         itlayout

   it_fieldcat                       itfcat

**   IT_EXCLUDING                      =

**   IT_SPECIAL_GROUPS                 =

**   IT_SORT                           =

**   IT_FILTER                         =

**   IS_SEL_HIDE                       =

*   I_DEFAULT                         = 'X'

*   i_save                            = 'A'

*   IS_VARIANT                        =

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   IS_PRINT                          =

*   IS_REPREP_ID                      =

*   I_SCREEN_START_COLUMN             = 0

*   I_SCREEN_START_LINE               = 0

*   I_SCREEN_END_COLUMN               = 0

*   I_SCREEN_END_LINE                 = 0

*   I_HTML_HEIGHT_TOP                 = 0

*   I_HTML_HEIGHT_END                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   IR_SALV_FULLSCREEN_ADAPTER        =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

  TABLES

    t_outtab                          = it_meas

* EXCEPTIONS

*   PROGRAM_ERROR                     = 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.





form top.

data: t_header type slis_t_listheader,

      wa_header type slis_listheader,

      t_line like wa_header-info,

      ld_lines type i,

      ld_linesc(10) type c.



* Title

  wa_header-typ  = 'H'.

  wa_header-info = 'Customer Detail Report'.

  append wa_header to t_header.

  clear wa_header.



* Date

  wa_header-typ  = 'S'.

  wa_header-key = 'Date: '.

  CONCATENATE  sy-datum+6(2) '/'

               sy-datum+4(2) '/'

               sy-datum(4) INTO wa_header-info.   "todays date

  append wa_header to t_header.

  clear: wa_header.



CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

  EXPORTING

    it_list_commentary       = t_header

*   I_LOGO                   =

*   I_END_OF_LIST_GRID       =

*   I_ALV_FORM               =

          .

endform.

 

But along with this infor also i want to mention the user name of the user executing the report.

RFC Function Module inSM58

$
0
0

Hi,

 

I Created RFC Function Module, Also a Port in SM59 of type T with program ID ECCRFC1. I am calling my RFC inside a program which is running in Back Ground Job. My Issue is A new record is created in SM58 with status "Transaction recorded" for Every time program is ran in background. I need to select the record and run the Execute LUW manually.

 

Does any one have Idea why record is sitting in Sm58 instead of executing LUW Automatically. I even have Commit Statement after my RFC, so that COMMIT statement can trigger & execute LUW automatically.

 

Thanks in Advance

how to access PFCG tcode by changing ABAP program.

$
0
0

Dear friends.

 

currently I dont have authority for accessing PFCG role maintainance. however I have development authority. Now what can I do to get the authority to access that tcode?

 

thanks

 

regards

concatenating PDF files

$
0
0

Hi,

 

   I need to call the Adobe form Function Module inside a loop. So I want to concatenate all PDF outputs in a Single PDF file. Here is my Function call code

 

 

call function iv_fm_name

     exporting

       /1bcdwb/docparams  = is_docparams

        bil_prt_com        = is_interface

importing

       /1bcdwb/formoutput = es_formoutput

     exceptions

       usage_error        = 1

       system_error       = 2

       internal_error     = 3

       others             = 4.

 

 

Any suggestions Please to get this done in my ABAP print Progam.

 

THanks

Swarna....

Get Manager for an Employee

$
0
0

Hi,

 

We have an employee which is assigned to two positions (say X & Y) each 50 %.

 

Different 'Reports to' relationship (A002) are defined for positions X & Y .

For example,

 

Position X A002  Position A

Position Y A002  Position B

 

We are using function module 'RH_GET_LEADER' to get manager for employee.

However this function module returns employee assigned to position A as Manager.

We want employee assigned to position B to be returned as manager.

 

How can this be achieved?

 

Regards,

Apurva


Out Put Screen

$
0
0

Hello Guys,

 

I need to generate a PP report in which the input screen is as follows.

 

clip_image002.jpg

which is done, Now the out put screen will be like this

 

DATE

DAY

LINE

DUTY HRS







 

 

 

 

 

   1.  Date and day

   2.  Line – Data can be derived in this column by

            

  • Pass Material (MKAL-MARA), Plant (MKAL-WERKS) which is entered in the input screen in the table MKAL to get the value of production line (MKAL-MDV01), Group (MKAL-PLNNR), Group counter (MKAL-ALNAL) and Prod.Ver. (MKAL-VERID). In this case only one set of data can be derived or material specific data will be derived.

Please help me with some piece of code how to generate this kind of out put and how to fill that Line column by joining DB tables.

Issue in GUI_DOWNLOAD

$
0
0

Hi all ,

 

We are facing an issue in GUI download .

We have to download few amounts in pounds symbol . I have used Codepage = 4103 and 4013 ; but while downloading

I am getting a prefix A in the excel downloaded via GUI_DOWNLOAD .

 

Please let me know how can I get only the figure with the pound symbol as a prefix for each column

 

Thanks

Supriya Murudkar

how to derive a date from a numeric value?!

$
0
0

Hello SAP-Experts,

 

I have created a generic data source containing the field: “Period”  which is defined as a numeric value (MM.YYYY).

 

In order to fill the InfoObjects “0CALMONTH” and “0CALYEAR” we have developed a formula with the formula editor.

 

This formula does not work because if you want to use the LEFT, RIGHT and CONCATENATE functions of the formula editor it is necessary that the value in with the date is provided is a string value.

 

Does anybody know how to convert a numeric value into a string value?

 

Or does anybody know an alternative to the RIGHT, LEFT and CONCATENATE functions

 

RIGHT( 4, 'SPBUP' )

CONCATENATE( RIGHT( 4, 'SPBUP' ), LEFT( 2, 'SPBUP' ) )

 

Thank you for your help!

 

Holger

Getting special characters while converting OTF to PDF

$
0
0

Hi Experts!

 

I am trying to convert the output of a sap script in PDF format For Poland. In print preview of script everything is correct, But when I see the same output in PDF, then it is showing some special characters in place of original text.

 

To get the output in PDF format I have used the function module  'CONVERT_OTF' .

 

Could you please help me out in removing these Special characters from PDF format  and to get the proper output as I am getting in Print preview of SAP SCRIPT.

 

Please find the attached screenshots.

about contract startdate

$
0
0

hai

 

i am new to this  sap plz help  me.

 

i am running transaction va41 tcode ,to find out where the contract start data will be stored programatically, i am trying to debug the program mv45afzz and trying to find out  where the contract startdate  present at the header data level. but i connot find the exact internal table or the userexit .

 

plz help in solve this issue plzzz

 

thank U.

Is it correct loop? The values are coming same for the field(txt50).

$
0
0

types: begin of ty_desc,

       saknr type saknr,

       txt50 type char50,

  end of ty_desc.

 

 

TYPES: BEGIN OF itycj_postings.

include type ty_desc.

TYPES: END OF itycj_postings.

 

 

data:  titcj_split_postings TYPE itycj_postings OCCURS 0 WITH HEADER LINE.

 

 

SELECT SINGLE * FROM tcj_c_journals

    INTO ls_journals

    WHERE comp_code  = sd_bukrs

      AND cajo_number = sd_canum.                        "Hw 0502865

 

 

  If Sy-subrc ne '0'.                                    "Hw 494272

     MESSAGE I011(F5A) WITH Sd_canum sd_bukrs.            "Hw 502865

     exit.                                                "Hw 494272

   Endif.                                                 "Hw 494272

 

 

 

select single * from tcj_transactions

  into ls_transaction

  where comp_code = ls_journals-comp_code.

 

 

 

 

 

 

SELECT single *    

FROM skat

INTO ls_skat

WHERE spras EQ sy-langu

and saknr = ls_transaction-gl_account.    

 

 

 

LOOP AT titcj_split_postings.

 

if ls_skat-saknr EQ ls_transaction-gl_account.    

 

titcj_split_postings-txt50 = ls_skat-txt50.

endif.

append titcj_split_postings.

endloop

 

 

In output, the value of txt50 is all same. Please reply what to do?

Dynamic generations of Rows and Columns in Script

$
0
0

Dear Experts,

Please let me to know how to solve this below mentioned issue.

 

How to generate dynamically the rows and columns in a script output based on the no:of records

For instance : If only two records exists, only two rows and necessary columns should appear.

 

Attempted : I had tried ULINE and VLINE commands, but it is not working properly.

I have to do this with the help of PERFORM and ENDPERFORM command.

Kindly suggest me how to calculate the dynamic positions using subroutines.

 

Regards

Veena


Tutorial ABAP debugger

$
0
0

Step 1: Put a static break-point at the desired location

 

image1.png

image1.png

Launch The Applicaton

 

 

image1.png

 

The Dubugging Mode is automatically triggered when the breakpoint is reached

 

image1.png

 

Press F5 for single line/step wise  execution or F6 for execution

 

image1.png

 

Pressing F5 ,helps you to enter within the Perform

Using the menu options: Breakpoints->breakpoint at -  various specific breakpoints lke breakpoint at exception,method,source code etc can also be set

 

 

For e.g. we can set a generic breakpoint at the statement ‘call’.

 

 

image1.png

 

 

     image1.png

 

 

         image1.png

image1.png

 

 

We can also create a watchpoint: for e.g.

 

image1.png

 

 

image1.png

image1.png

utilizing structure created in program as a standard structure

$
0
0

Hi all,

I am creating a reusable function module for my project in which i want to merge reuse_alv_grid _display and reuse_field catalog_merge and later mail sending functionality .....now i will not be  able to pass structure created in my program  to reuse_field catalog_merge(neither in strucure nor in internal table) as the structure name in reuse_field catalog_merge shall take only a standard structure ..so is there any way  i can make the function module accept my final internal table structure which i wanted to display in alv

 

i am posting my func mod code over here

 

FUNCTION Z_ALV_DISPLAY.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_INTERNAL_TABNAME) TYPE  SLIS_TABNAME OPTIONAL
*"     VALUE(I_STRUCTURE_NAME) TYPE  DD02L-TABNAME OPTIONAL
*"  TABLES
*"      T_OUTTAB
*"  EXCEPTIONS
*"      PROG_ERROR
*"----------------------------------------------------------------------


data : f_cat type SLIS_T_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
*   I_PROGRAM_NAME               =
    I_INTERNAL_TABNAME           = I_INTERNAL_TABNAME
*    I_STRUCTURE_NAME             =  I_STRUCTURE_NAME
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
   CHANGING
     ct_fieldcat                  = f_cat
  EXCEPTIONS
    INCONSISTENT_INTERFACE       = 1
    PROGRAM_ERROR                = 2
    OTHERS                       = 3
           .
IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
    I_CALLBACK_PROGRAM                = sy-repid
*   I_CALLBACK_PF_STATUS_SET          = ' '
*   I_CALLBACK_USER_COMMAND           = ' '
*   I_CALLBACK_TOP_OF_PAGE            = ' '
*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*   I_CALLBACK_HTML_END_OF_LIST       = ' '
*   I_STRUCTURE_NAME                  =
*   I_BACKGROUND_ID                   = ' '
*   I_GRID_TITLE                      =
*   I_GRID_SETTINGS                   =
*   IS_LAYOUT                         =
     IT_FIELDCAT                       = f_cat
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
*   I_SAVE                            = ' '
*   IS_VARIANT                        =
*   IT_EVENTS                         =
*   IT_EVENT_EXIT                     =
*   IS_PRINT                          =
*   IS_REPREP_ID                      =
*   I_SCREEN_START_COLUMN             = 0
*   I_SCREEN_START_LINE               = 0
*   I_SCREEN_END_COLUMN               = 0
*   I_SCREEN_END_LINE                 = 0
*   I_HTML_HEIGHT_TOP                 = 0
*   I_HTML_HEIGHT_END                 = 0
*   IT_ALV_GRAPHICS                   =
*   IT_HYPERLINK                      =
*   IT_ADD_FIELDCAT                   =
*   IT_EXCEPT_QINFO                   =
*   IR_SALV_FULLSCREEN_ADAPTER        =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
   TABLES
     t_outtab                          = t_outtab
* EXCEPTIONS
*   PROGRAM_ERROR                     = 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.




ENDFUNCTION.

BAPI_ACC_DOCUMENT_POST error

$
0
0

Hi,

 

I am getting error message while posting the document using BAPI BAPI_ACC_DOCUMENT_POST

i.e. " Value"000100" is not allowed for characteristics "Sales Ord. Item".

 

 

Thanks

Parag

adding a new field in the customized alv report which is copied from standard report.

$
0
0

Hi experts,

 

The client wanted cash journal report. I copied RFCASH20 to a zreport and commented all the fields which is not required by the client. Now the client wants G&L description(txt50) which is in skat table. I dont know how to display this field in the alv report. Kindly help.

Can any explian me how to apply this script logic into smartforms?

$
0
0

TABLES: MKPF,   MSEG,   EKKO,  LFA1.

   

 

DATA: BEGIN OF ITAB OCCURS 10,

        MBLNR LIKE MKPF-MBLNR, "MATL DOCN. NUMBER

        XBLNR LIKE MKPF-XBLNR, "DELVERY NOTE NUMBER

        BUDAT LIKE MKPF-BUDAT, "MAT.DOC.POSTING DATE

        BLDAT LIKE MKPF-BLDAT, "GRN DATE



        LIFNR LIKE MSEG-LIFNR, "SUPPLIER NUMBER

        EBELN LIKE MSEG-EBELN, "PO NUMBER

        MATNR LIKE MSEG-MATNR, "MATERIAL NUMBER

        MEINS LIKE MSEG-MEINS, "UNIT OF MEASURE

        LSMNG LIKE MSEG-LSMNG, "ADVISED QUANTITY

        ERFMG LIKE MSEG-ERFMG, "RECEIVED QUANTITY



        ZEILE LIKE MSEG-ZEILE, "LINE ITEM NUMBER

        SGTXT LIKE MSEG-SGTXT, "TEXT(LOCATION)



        BISMT LIKE MARA-BISMT, "OLD MATERIAL NUMBER



        WEMPF LIKE MSEG-WEMPF, "GOODS RECEIPIENT(VERIFIED BY)



        BEDAT LIKE EKKO-BEDAT, "PO DATE



        NAME1 LIKE LFA1-NAME1, "SUPPLIER NAME

        ORT01 LIKE LFA1-ORT01, "CITY

        PSTLZ LIKE LFA1-PSTLZ, "POSTAL CODE



        MAKTX LIKE MAKT-MAKTX, "MATL DESCRIPTION



        J_1IEXRN LIKE J_1IMOVEND-J_1IEXRN, "EXCISE REGN NO



        EXCESS LIKE MSEG-LSMNG, "EXCESS QTY

        SHORT  LIKE MSEG-LSMNG, "SHORT QTY





        WERKS LIKE MSEG-WERKS, "PLANT

        LGORT LIKE MSEG-LGORT, "STORAGE LOCATION

        ABLAD LIKE MSEG-ABLAD, "UNLOADING POINT

        LGPBE LIKE MARD-LGPBE, "STORAGE BIN

        CHARG LIKE MSEG-CHARG,

      END OF ITAB.


SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T1.

PARAMETERS S1 LIKE MKPF-MBLNR MATCHCODE OBJECT ZGRNLIST OBLIGATORY.

SELECT-OPTIONS S3 FOR MSEG-ZEILE NO-EXTENSION.

SELECTION-SCREEN END OF BLOCK B1.



INITIALIZATION.

  T1 =  'Matnr & YEAR'.



START-OF-SELECTION.


  SELECT MKPF~MBLNR MKPF~XBLNR MKPF~BUDAT MKPF~BLDAT MSEG~LIFNR

                 MSEG~EBELN   MSEG~MATNR MSEG~MEINS MSEG~LSMNG MSEG~ERFMG MSEG~ZEILE MSEG~SGTXT

                 MSEG~WEMPF MSEG~WERKS MSEG~LGORT MSEG~ABLAD  MSEG~CHARG

                INTO CORRESPONDING FIELDS OF TABLE ITAB

                FROM MKPF INNER JOIN MSEG

               ON MKPF~MBLNR = MSEG~MBLNR

                WHERE MKPF~MBLNR = S1

                AND MSEG~BWART = '101'

               AND MSEG~ZEILE IN S3.





  LOOP AT ITAB.

    SELECT SINGLE BEDAT FROM EKKO INTO CORRESPONDING FIELDS OF ITAB

    WHERE EBELN = ITAB-EBELN.


    SELECT SINGLE NAME1 ORT01 PSTLZ FROM LFA1 INTO CORRESPONDING

    FIELDS OF ITAB WHERE LIFNR = ITAB-LIFNR.


    SELECT SINGLE MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF ITAB

    WHERE MATNR = ITAB-MATNR.


    SELECT SINGLE BISMT FROM MARA INTO CORRESPONDING FIELDS OF ITAB

    WHERE MATNR = ITAB-MATNR.


    SELECT SINGLE J_1IEXRN FROM J_1IMOVEND INTO CORRESPONDING FIELDS

    OF ITAB WHERE LIFNR = ITAB-LIFNR.


    SELECT SINGLE LGPBE FROM MARD INTO CORRESPONDING FIELDS OF ITAB

    WHERE MATNR = ITAB-MATNR AND WERKS = ITAB-WERKS AND

    LGORT = ITAB-LGORT.


    IF ITAB-LSMNG <= ITAB-ERFMG.

      ITAB-EXCESS = ITAB-ERFMG - ITAB-LSMNG.

      MODIFY ITAB.

    ENDIF.



    IF ITAB-LSMNG >= ITAB-ERFMG.

      ITAB-SHORT = ITAB-LSMNG - ITAB-ERFMG.

      MODIFY ITAB.

    ENDIF.



  ENDLOOP.

Viewing all 8332 articles
Browse latest View live


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