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

Issues while using READ REPORT 'rep' INTO 'itab'

$
0
0

Hello,

 

I have a requirement where in I need to read a report and then further process it. I then need to read the lines of the report and take some variables based on the calls my read report has made.

 

Issue I am facing here is when I tried to read the report it took it as it is in my ITAB but not as each executable line in one line. For example:

REP1 has a concatenate statement which I have written like below

CONCATENATE

                         'This is Output.'

                         var1 var2

                         into var3

                         separated by space.

Now when I read this REP1 in my REP2 I got these lines like this itself rather I want it like one executable mine in one line. My requirement is to read one executable line at a time and process it.

So my read report internal table should give me:

CONCATENATE 'This is Output.' var1 var2 into var3 separated by space.

Likewise I may have any number of lines and any number of statements.

 

Is there any way to achieve this requirement? Pls help !!

 

Thanks

Harjeet


table maintenance generator

$
0
0

Hello Experts ,

 

I am trying to create table maintenance for a table with 111 fields  , but I am getting

1.an error saying screen cannot be generated ,

2.memory for screen load is used up. bytes) is not available

 

I am creating with 2 step. but still same error.

 

any ideas how to overcome this problem?

 

Thanks in advance.

BAPI_ACC_DOCUMENT_POST - Discount Calculation not happening.

$
0
0

Hi,

 

I'm using BAPI_ACC_DOCUMENT_POST to post Vendor Accounting document .

 

In FB01 if we put Discount base, the discount is automatically calculated from payment term and a new GL line is created with the discount amount and the original GL line value is adjusted automatically whilie saving.

 

But this is not happening when I create AP document using the BAPI, the discount is not calculated.

 

Please let me know if you have any idea how to do it.

 

Thanks,

Surendra Maggi.

Restricting the processing of line items using badi in me51n t-code

$
0
0

sir,

 

While creating PR using T Code ME51N a check should be made to restrict processing if the line items contain material of type ‘ZERS’

Within this badi, material lines need to be checked from table MARA . If the material type fetched from MARA is ‘ZERS’ , check account assignment within parameter,If the a/c assignment is ‘K’ system should throw an error message saying ‘Creation of PR for ‘ZERS’ material with A/C assignment ‘K’ is not permitted. ’

 

pls suggest the exact badi, where i can incorporate my code for ME51N (Purchase Requistion).

BAdI impl. ME_PROCESS_PO give an error message but the PO can also be saved

$
0
0

Hi experts,

 

I implement BADI ME_PROCESS_PO and make some check in method IF_EX_ME_PROCESS_PO~PROCESS_ACCOUNT.

In this method I give an error message using:

mmpur_message 'E' '/FMFMS/FM' '041' '' '' '' ''.

But when I save the error PO it can also be saved.

will you please kindly tell me how to solve the problem?

 

Best regards,

Tracy

 

How can I export a table from a function module

$
0
0

Hello friends,

 

I want to know how can I export an internal table from a function module, for example, in the export tab I want to have my table called IT_DATA

 

but for insert parameters in the export tab, I need have these objects in the ABAP DICTIONARY but I don't know how can I define this internal table into the ABAP DICTIONARY, is this possible?

 

And, If I want to export a table from a function module. ¿Where I have to define the table? in the EXPORT tab or in  TABLES tab?

 

Best regards,

Luis.

Upload program for MIRO Transaction

$
0
0

Hi,

 

I have searched over net but did not find suitable program/FM/Tricks for my requirement. Actually I had record a BDC for Miro Transaction but unfortunately not working. Searching a BAPI for MIRO TCode but all BAPI have a Parameter PO Number, so it was not for my requirements.

 

Requirement is : Create a uploading program without reference of PO but have give a Vendor Code and Material Code. So, Please guide me how to do this. Transaction Code is MIRO .

 

 

Thanks in Advance.

 

Ram Shanker

Smartform: Line is not fully printed

$
0
0

Hi Friends,

I am using Old table in Smartform for the item details. I need to draw a line seperator between each line item on the invoice form.
If I use Underscore(_) continuosly in text module, it shows dotted line in print preview and it shows only 75% of line in Print out.
If I use minus symbol continuosly in Text module, it shows 100% solid line which is good in print preview,but dotted line in Print out.

 

find the below example, If we give minus(-) then it diaplay as dotted line and it comes 100% of window width.

if we gie underscore( __ ). then it diaplay as dotted line and it comes 75% of window width.

 

Header 1

Material  material decription                                             UOM               amount

AAAA

------------------------------------------------------------------------------------------------------------------------------

_________________________________________

 

 

 

Thanks in advance,

Vallamuthu M


Change of System variable sy-uname during the program execution

$
0
0

Hi,

I wanted some help, if it is possible to change  value of sy-uname during the program execution.

I am mentioning the flow of the execution as follows.

 

Step 1. Intially sy-uname is having the value of the login user, for example say 'user1'.

Step 2. I want to set the sy-uname to 'user2' and after that i call a function or a method. The system should take the sy-uname as 'user2' for executing the function or method.

Step 3. Once the control comes back from the function or method call the sy-uname should be set to the logged in user.

 

Regards,

Om

Roles that are authorized for a Company Code

$
0
0

Hello

 

Would you help me write an ABAP program that reads list of ABAP roles (or a single role) authorized for a FI Company Code. Roles that have a particular company code set in their authorization Data using PFCG.IAll  know is that we got to deal with authorization objects and AGR_* tables. But if you could help me with exact steps or share an ABAP Program, that will be a great help.

 

I hope my requirement is clear. Many Thanks in advance.

 

Regards

PG

How to save OLE2_Object in AL11 directory ?

$
0
0

Hi Experts,

 

I have created an excel sheet using ole2incl. Here is the snippet of the program

create object gobj_excel 'EXCEL.APPLICATION'.

Set Property of gobj_excel 'Visible' = 1.

call method of  gobj_excel 'workbooks' = gobj_workbook.

call method of  gobj_excel 'worksheets' = gobj_sheet.

.....

.....

call method of gobj_sheet 'SaveAs'

Exporting

#1 = <lv_destName>

#2 = 1 .

 

In the <lv_destname> i need to use the location specified in AL11 . So i have wrote the code

SELECT SINGLE dirname INTO  lv_dir_param FROM user_dir WHERE aliass = 'ABC'.

after the execution of above statement i get the value lv_dir_param = /ABC/XYZ .

I concatenate time stamp into the lv_destname

CONCATENATE lv_dir_param '/' sy-datum into lv_destname and try to use it .

When i call the  function module  GUI_UPLOAD passing the lv_destname as the input parameter. I get the error saying it cannot process the file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lv_destname

filetype  ="BIN'

...

...

PLEASE HELP ME OUT ON THIS. I HAVE BEEN TRYIGN TO SOLVE THIS THING FOR DAYS.

 

I was told that i need to use DATASET in order to read or write in UNIX envirnoment. How can i use DATASET without having saved the excel sheet, I dont have the values of the excel sheet in any internal table.

Dump error while scheduling a job which sends emails to all employees

$
0
0

Hi Everyone,

 

We have a requirement, by which an executable ABAP program should send emails to all employees of the organization with the PDF attachment of their salary payslips.

 

Hence I have built a program which generates the PDF document, attaches it to the email and sends to all on roll employees of the organization using CL_BCS class.

And another program which validates the user inputs, that is payroll period and year and schedules the above program in the background using JOB_OPEN and JOB_CLOSE with SUBMIT statement in between them.

 

When I tested the development for a few hundred employees, it worked but as i ran for a mass of employees, the job got canceled due to a runtime exception.

A RAISE statement in the program "CL_GUI_HTML_VIEWER============CP" raised the

  exception

condition "CNTL_ERROR".

 

Also, after a few analysis with the SOST transaction where in we can see the list of the emails sent, I have observed that on background execution initial few records of the internal table I use are going missing.

 

Please advice.

MD04 - Adding favourites

$
0
0

Hello experts,

 

While we add a favourite in the MD04 menu.I assign the T.Code .

 

My problem is that when I call this transaction , I want to skip the initial screen by assigning the parameter values with the value of the MRP element which I called this transaction from .

 

i.e, When we create a favourite, we enter the T.Code .

Then we have the Parameter ID.

But how to we fill the Parameter value dynamically

 

Regards,

Shubhendu

RF screens developement

I need Help on sending e-mail with attachments.

$
0
0

I have a report that should send an e-mail which contains e-mail body and attachment (HTML)

 

With some calculations i have Created an Internal Table  lets say lt_test ( this Table should be sent in attachment)

 

 

 

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

* email part start*

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

 

 

WRITE: /' E-mail body ', lv_var1.      " this variable is being taken from the above part pf the report

 

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

*** saving a List  which is used to create e-mail Body.

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

 

  CALL FUNCTION 'SAVE_LIST'
    EXPORTING
list_index         = sy-lsind
    TABLES
      listobject         = li_listobject
    EXCEPTIONS
      list_index_invalid = 1
      OTHERS             = 2.
  IF sy-subrc NE 0.
    RAISE invalid_list.
  ENDIF.

 

 

 

* Convert the list to ALI format
CALL FUNCTION 'TABLE_COMPRESS'
     TABLES
       in             = li_listobject
       out            = li_ali
     EXCEPTIONS
       compress_error = 1
       OTHERS         = 2.
  IF sy-subrc NE 0.
    RAISE compress_error.
  ENDIF.


...... the part where I am geting the e-mail adresses

 

 

 

lr_request = cl_bcs=>create_persistent( ).   """""" creating  request

      lr_document = cl_document_bcs=>create_document(                  """""""Here should be the Mail body
                          i_type      = 'ALI'
                          i_text      = li_ali
                          i_length    = lv_textlength
                          i_subject   = 'Test subject' ).    


     lr_document->add_attachment( i_attachment_type    = 'ALI'         """""""Here should tha attachment added to the E-mail.
                                i_attachment_subject = 'Test attachment'
                                i_att_content_hex    = (internal Table) ??????).

Result that i want.

 

Sending E-mail with text (e-mail Body) and with attachment the Internal table (lt_test)

Format of the attachment HTML or Excel.

 

Questions:

1) In which format and how should I convert the Internal table lt_test so that the attachment can be readable to the receiver ?

 

 

Thank you in advance for your answers.

 

Best Regards,

Erion.



ME21N Validation while creating the PO

$
0
0

Dears,

 

I have to put the validations, while  saving the PO while (creating/changing). so i have selected  Enhacement MM06E005 , user exit EXIT_SAPMM06E_012 and include ZXM06U43 . My code getting trigger. BUT first showing the popup like HOLD, EDIT  and  CANCEL. Before this HOLD,EDIT and CANCEL POPUP , my error message should be appear AND this HOld,EDIT and CANCEL popup shol not come( IF my code trigs .)

 

IF SY-TCODE = 'ME21N' OR SY-TCODE = 'ME21' OR SY-TCODE = 'ME22N' OR

    SY-TCODE = 'ME22' OR SY-TCODE =  'ME31L' OR SY-TCODE = 'ME32L' OR

    SY-TCODE = 'ME23N' OR SY-TCODE = 'ME23' OR SY-TCODE = 'ME33L'.

 

IF

 

      ( I_EKKO-BSART = 'NAUB' AND I_EKKO-RESWK = '8400' )

   OR ( I_EKKO-BSART = 'NAUB' AND I_EKKO-RESWK = '8440' ).

 

   MESSAGE E061(ZMM01) WITH I_EKKO-BSART.."WITH  'PLEASE CHOOSE CORRECT DOCU TYPE FOR THIS SUPPLYING PLANT'.

LEAVE TO SCREEN 500.

ENDIF.

 

ENDIF.

Enhancement/Exit for FB03

$
0
0

Hi All,

 

I need a help in finding a suitable userexit or badi for my requirement in FB03.

My requirement is, I need to add a custom button in FB03 transaction for printing the layout of 'cash payment' or 'cash receipts' from FB03. I have to add a custom button in transaction FB03 for printing, by clicking on that button it shows me the custom smartform I developed for 'cash payment' or 'cash receipts'.

I just need a BADI or user-exit with the help of which I can add a custom button along with the standard button 'General Ledger View' in FB03 transaction. Please help me.

 

Thanks in advance for the help.

 

Regards,

Prameet Gopal Verma

I have a module pool program, in that i have to set validation.

$
0
0

There is a field service order whenever user will enter service order number it should match with

ekko's ebeln if it doesn't then a message should come(enter correct serv order number)..how can i set validation on this??

 

I tried this in PAI..

 

when 'ENTER'.

 

if wa_data-sn1 = ekko-ebeln.
             wa_data-sn1 = wa_data-sn1.
          ELSE.
    MESSAGE 'Enter Correct Serivce Order Number' TYPE 'E'.
   ENDIF.

 

when i i am entering wright serv order no. then also it is showing error and for wrong also.

 

here wa_data-sn1(serv order number) is I/O text field.

 

what to do??

HR_INFOTYPE_OPERATION FM not updating infotype values

$
0
0

Experts,

 

I am using 'HR_INFOTYPE_OPERATION' FM to update the Custom fields, while executing there is no error messages in the return table but the same time it is not modifying the records. Please suggest me how to get the solution.

Infotype i am updating is 40 and subtype 90.

 

CALLFUNCTION'HR_INFOTYPE_OPERATION'

           EXPORTING

             INFTY            = P_ITY

             NUMBER           = WA_PA0040_T-PERNR

             SUBTYPE          = WA_PA0040_T-SUBTY

*           OBJECTID         = WA_PA0040_T-OBJPS

*           LOCKINDICATOR    = WA_PA0040_T-SPRPS

             VALIDITYEND      = WA_PA0040_T-BEGDA

             VALIDITYBEGIN    = WA_PA0040_T-ENDDA

            RECORDNUMBER     = '000'"WA_PA0040_T-SEQNR

             RECORD           = WA_PA0040_T

             OPERATION        = 'MOD'

             TCLAS            = 'A'

             DIALOG_MODE      = '0'

*           NOCOMMIT         = ''

*           VIEW_IDENTIFIER  = '07'

*           SECONDARY_RECORD =

           IMPORTING

             RETURN           = WA_ITYRET

             KEY              = WA_KEY.

How can I use hotspot click in an ALV grid?

$
0
0

Hello,

 

I have a table that is displayed in an ALV grid and I would like to have one of the columns as clickable icons.

For example:

 

Print  |  Doc. Type | Name

--------------------------------------

(icon) |   .docx      | first

(icon) |   .pdf         | second ... and so on.

 

I would like to click in the icon (Print column) and execute an action, but no matter what I do I can't set the action.

I know that is not just setting "fieldcatalog-hotspot='X'", but I don't know how to use a hotspot handler.

 

Here's some of the code I have:

 

TYPES: BEGIN OF ty_docs,
                   
print LIKE ICON-ID,

                    doc_type LIKE table_doc-TYPE,
                    name LIKE table_doc-NAME,

             END OF ty_docs.

DATAoref_dock TYPE REF TO cl_gui_docking_container,
            oref_alv TYPE REF TO cl_gui_alv_grid,
            i_fieldcat TYPE lvc_t_fcat,
            aux_fieldcat TYPE lvc_s_fcat,
            aux_lay TYPE lvc_s_layo,
            i_exclude TYPE TABLE OF syucomm,
            i_docs TYPE ty_docs,
            t_docs LIKE TABLE OF i_docs.

AT SELECTION-SCREEN OUTPUT.

   APPEND 'ONLI' TO i_exclude.
   APPEND 'SJOB' TO i_exclude.
   APPEND 'PRIN' TO i_exclude.

   CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
     EXPORTING
       p_status = sy-pfkey
       p_program = sy-repid
     TABLES
       p_exclude = i_exclude.

AT SELECTION-SCREEN.


   CHECK sy-ucomm = space.

     SELECT
          
icon~ID AS print

           doc~TYPE AS doc_type
           doc~NAME as name
             INTO CORRESPONDING FIELDS OF TABLE t_docs
             FROM table_docAS doc
                  INNER JOIN ICON AS icon    
                    ON icon~NAME EQ 'ICON_PRINT'
             GROUP BY icon~ID doc~TYPE doc~NAME.


   IF sy-subrc = 0.
     IF oref_dock IS NOT BOUND.
       CREATE OBJECT oref_dock
          EXPORTING
            repid = sy-repid
            dynnr = sy-dynnr
            side = cl_gui_docking_container=>dock_at_bottom
            ratio = 90
         EXCEPTIONS
           OTHERS = 1.
     ENDIF.
     IF oref_alv IS NOT BOUND.
       CHECK oref_dock IS BOUND.
       CREATE OBJECT oref_alv
         EXPORTING
           i_parent = oref_dock
         EXCEPTIONS
           OTHERS = 1.

       CHECK oref_alv IS BOUND.

       aux_fieldcat-fieldname = 'PRINT'.
       aux_fieldcat-coltext = 'Print'.
       aux_fieldcat-ref_table = 't_docs'.
       aux_fieldcat-ref_field = 't_docs-print'.
       aux_fieldcat-edit = ''.
       aux_fieldcat-just = 'C'.
       aux_fieldcat-hotspot = 'X'.
       aux_fieldcat-outputlen = 10.
       aux_fieldcat-col_pos = 0.
       APPEND aux_fieldcat TO i_fieldcat.
       CLEAR aux_fieldcat.

       aux_fieldcat-fieldname = 'TYPE'.
       aux_fieldcat-coltext = 'Doc. Type'.
       aux_fieldcat-ref_table = 't_docs'.
       aux_fieldcat-ref_field = 't_docs-doc_type'.
       aux_fieldcat-edit = ''.
       aux_fieldcat-outputlen = 15.
       aux_fieldcat-col_pos = 1.
       APPEND aux_fieldcat TO i_fieldcat.
       CLEAR aux_fieldcat.

       aux_fieldcat-fieldname = 'NAME'.
       aux_fieldcat-coltext = 'Name'.
       aux_fieldcat-ref_table = 't_docs'.
       aux_fieldcat-ref_field = 't_docs-name'.
       aux_fieldcat-edit = ''.
       aux_fieldcat-outputlen = 12.
       aux_fieldcat-col_pos = 2.
       APPEND aux_fieldcat TO i_fieldcat.
       CLEAR aux_fieldcat.

       aux_lay-grid_title = 'Docs'.
       aux_lay-edit = ''.

       CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
         EXPORTING
          i_structure_name = 'ty_docs'
          i_internal_tabname = 't_docs'
        CHANGING
          ct_fieldcat = i_fieldcat
       EXCEPTIONS
         OTHERS = 3.

       CALL METHOD oref_alv->set_table_for_first_display
         EXPORTING
           i_structure_name = 'ty_docs'
           is_layout = aux_lay
         CHANGING
           it_fieldcatalog = i_fieldcat
           it_outtab = t_docs
         EXCEPTIONS
           OTHERS = 1.
     ELSE.
       CALL METHOD oref_alv->refresh_table_display
         EXCEPTIONS
           OTHERS = 1.
     ENDIF.
  ENDIF.

 

 

 

Thank you so much in advance!

Viewing all 8332 articles
Browse latest View live


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