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

Error Transporting a program.

$
0
0

Hi all, i have a standard program, this standard program have 5 includes:

 

 

*Data Declarations

INCLUDE rpfiglmx_eaccounting_data.

*Selection Screen

INCLUDE rpfiglmx_eaccounting_sel.

*Main Processing

INCLUDE rpfiglmx_eaccounting_main.

*Subroutines

INCLUDE rpfiglmx_eaccounting_form.

*ALV tree Output

INCLUDE rpfiglmx_eaccounting_sf01.


i touched:


INCLUDE rpfiglmx_eaccounting_form.


Yes, i know i know, not modify a standard program, its a little modification, the program ask for a filepath on the server, i write some code for make the path static and read only.


For do this modification asked me a access Key.


Checked the syntax and activated the program, created a request for transport from dev to qas, when the Basis ppl, try transport get an error:


Syntax error on line 000022, program RPFIGLMX_EACCOUNTING_MAIN, FORM CHECK_REQ_T does not exist,


Don't know/understand why, i don't touch this part(include) of the program, this line is:



PERFORM check_req_t.


if i do 2 clicks on: check_req_t. the editor show the FORM:



FORM check_req_t .

   IF p_treq IS NOT INITIAL.

     IF p_treq = 'AF' OR p_treq = 'FC'.

       IF p_ord IS INITIAL.

         SET CURSOR FIELD 'P_ORD'.

         MESSAGE text-050 TYPE 'E'.

       ENDIF.

     ELSEIF p_treq = 'DE' OR p_treq = 'CO'.

       IF p_pro IS INITIAL.

         SET CURSOR FIELD 'P_PRO'.

         MESSAGE text-051 TYPE 'E'.

       ENDIF.

     ENDIF.

   ENDIF.

ENDFORM.



not know why the error, also i modified (a comment on this Form, for create a new TranportOrder, but again show me same error:


Syntax error on line 000022, program RPFIGLMX_EACCOUNTING_MAIN, FORM CHECK_REQ_T does not exist,


any advice how to remove these error?


Thanks.


Batch characteristics values needed in an internal table.

$
0
0

Hi Abapers,

 

I need 2 values from batch characteristics(ex: xyz_batch) for material say 'GTD' and 'Country'. Also i need material (matnr) and external material group (extwg).

 

I need these 4 values in an internal table (say final_itab = GTD, Country, matnr, extwg). GTD and Country are batch characteristic values from batch.

Then i need to sort the itab by extwg GTD Country.

 

Can anyone please help me with the code.

Thank You.

Update Program

$
0
0

I have a scenario where I need to update a table. This is a database table. I tried to use Update in my program but it does not work when my WHERE condition is not there in the table already.  It works if I manually add 'D' in SPRAS field of the table.  This is my syntax.

 

    UPDATE T005T SET
        landx = 'Afri'
        natio = 'Af'
    WHERE spras = 'D'.


but when I run my program. It does not update the table. one thing is that SPRAS = 'D' entry is not there. I think UPDATE should create the entry if it is not there already but it is not working. I tried to add the entry manually and ran the program and my program worked. can some one tell me what is missing here?

Thanks.

abapOpenChecks - Open source checks SAP Code Inspector / ATC

$
0
0

Over the last 6 months I've been working on a set of custom checks for code inspector, the project is available on github.

 

Currently it contains the following general purpose checks, some complex and some simple.

 

CHECK_01 - IF in IF

CHECK_02 - EXIT outside of loop

CHECK_03 - TRY without CATCH

CHECK_04 - Line length

CHECK_05 - 7 bit ASCII

CHECK_06 - Check for use of pretty printer

CHECK_07 - Functional writing style for CALL METHOD

CHECK_08 - Obsolete statement

CHECK_09 - Tab instead of spaces

CHECK_10 - Use icon_ constants

CHECK_11 - Max one statement per line

CHECK_12 - Specify SORT order

CHECK_13 - Sequential blank lines

CHECK_14 - Commented code

CHECK_17 - Definitions in top of routine

CHECK_18 - Empty branch

CHECK_19 - Use LINE OF

CHECK_20 - Bad indentation

CHECK_21 - Unused FORM parameter

CHECK_22 - Conditions contain identical code

CHECK_23 - CHECK outside of loop

CHECK_24 - Identical code blocks

CHECK_25 - Selection screen data not referenced statically

CHECK_26 - No direct changes to standard tables

 

You can configure code inspector or ATC to use these checks in your default variant.

checks.png

 

The checks are provided "AS IS", some might not fit your development requirement, and some might be slow or not even work.

This is a box of chocolates; take the ones you like . Some of the checks contains settings so it is possible to change to fit your requirements.

 

Feel free to submit pull requests or open issues. More checks will be added over time.

 

https://github.com/larshp/abapOpenChecks

Data Element Documentation Status

$
0
0

To ensure that documentation is not missed for a data element we set the documentation status as Object requires documentation.

 

Goto  -> Documentation -> Status -> Choose 'Object requires Documentation'

 

The query is that, can we get the list of Data Elements where the Documentation status is set to 'Object requires Documentation' ?

How to keep internal table column name lower case?

$
0
0

Is there a way to keep the column names for a internal table "lower case" when passing it to a "Call Transformation" to convert the data to json?  I really need the column names to be lower case since the js i'm using requires the keys to be lowercase to properly build out the structure.  When the transformation occurs it's making the column names uppercase.

 

CALL TRANSFORMATION id

         SOURCE test     = itest

         RESULT XML json_writer.

 

Here is the internal table.

 

TYPESBEGIN OF test,

                  id      TYPE string,

                  parent  TYPE string,

                  text    TYPE string,

              END OF test.

 

   DATA: wa_test     TYPE test,

              itest          TYPE STANDARD TABLE OF test.

Errors with BAPI_ACC_DOCUMENT_CHECK

$
0
0

Dear Experts,

 

I've been having errors with my codes for executing BAPI_ACC_DOCUMENT_CHECK.

Eventually, I will also need to run the same codes for BAPI_ACC_DOCUMENT_POST too.

 

Here is how I have populated the input parameters for the BAPI_ACC_DOCUMENT_CHECK:-

 

1) Input parameter, DOCUMENTHEADER:-

 

USERNAME = 'SY-UNAME'

HEADER_TXT = 700/003350

COMP_CODE = 8000

DOC_DATE = 05.03.2015

PSTNG_DATE = 19.01.2015

 

(Other fields are left blank here.)

 

2) Input parameter, ACCOUNTGL:-

 

ITEMNO_ACC = 1

ACCT_TYPE = D

FIS_PERIOD = 01

FIS_YEAR = 2015

CUSTOMER = 10005

 

(Other fields are left blank here.

Only 1 data record is populated for this internal table.)


Executing the BAPI with just these two input parameters above will not return any error messages at all.

 

3) Input parameter, CURRENCYAMOUNT:-

 

ITEMNO_ACC = 1

CURR_TYPE = 00

CURRENCY = GBP

AMT_DOCCUR = 40.2500

 

(Other fields are left blank here.

Only 1 data record is populated for this internal table.)

 

But, when I add the third input parameter as shown above, these error messages will be returned:-


RW 609: Error in document: BKPFF

RW 022: FI/CO interface: Balance in transaction currency

 

If I change the data value for CURRENCYAMOUNT-CURR_TYPE to 10, these error messages will be returned:-

 

RW 609: Error in document: BKPFF

RW 021: FI/CO line item without transaction currency information

 

P/S:

I have also tried adding another data record to the input parameter, CURRENCYAMOUNT as follows, but the same errors still persist:-

 

ITEMNO_ACC = 2

CURR_TYPE = 00

CURRENCY = GBP

AMT_DOCCUR = 40.2500-

 

How may I pass this BAPI execution successfully, with currency amounts?

 

Please do advise. Appreciate any inputs at all.

 

Thanks in advance.

 

 

Deborah

disable a field when status AALK is set in CJ20N

$
0
0

Hello all,

 

in CJ20N -transaction when Status 'AALK' is set

 

i want to disable outline agreement field,

 

how do achieve this..

 

thanks in advance...


SALV rebuild fieldcatalog at runtime

$
0
0

Hello,

 

Can somebody give me a hint how to change the fieldcatalog at runtime for class cl_salv_table? I want first display a structure "A" and then change the output table to structure "B" or "C" and so on. The method "refresh" with a full table refresh is not working.


FORM display_idocs_seg_data USING uv_idoc_seg_data TYPE edid4.

* local data definition ---------------------------------------------*
   STATICS: lr_outtab         TYPE REF TO data,
                  lr_outtab_line   TYPE REF TO data.

   FIELD-SYMBOLS:
       <lt_seg_data> TYPE STANDARD TABLE,
       <ls_seg_data> TYPE any.

* procedure ---------------------------------------------------------*

   CREATE DATA lr_outtab TYPE STANDARD TABLE OF (uv_idoc_seg_data-segnam).
   ASSIGN lr_outtab->* TO <lt_seg_data>.

   CREATE DATA lr_outtab_line TYPE (uv_idoc_seg_data-segnam).
   ASSIGN lr_outtab_line->* TO <ls_seg_data>.

   <ls_seg_data> = uv_idoc_seg_data-sdata.
   APPEND <ls_seg_data> TO <lt_seg_data>.

     TRY.
         cl_salv_table=>factory(
           EXPORTING
             r_container  = gr_graphic_parent3
           IMPORTING
             r_salv_table = gr_salv_segdata_table
           CHANGING
             t_table      = <lt_seg_data> ).
       CATCH cx_salv_msg.
     ENDTRY.

     PERFORM set_functions CHANGING gr_salv_segdata_table.

     gr_salv_segdata_table->display( ).
     gr_salv_segdata_table->refresh( EXPORTING refresh_mode = if_salv_c_refresh=>full ).


ENDFORM.  

 

Thanks for you help.

Variant in ALV header

$
0
0

Hi,

 

I'm a begginer in ABAP and I need some help.

 

I need to get a variable at the header (TOP-OF-PAGE) of the ALV function module REUSE_ALV_GRID_DISPLAY. The variable I need to show is the meterial number. I've written the following code:

 

I've defined an internal table like:


*Define data types for itab lines
TYPES: BEGIN OF lnalv_type,
         banfn TYPE eban-banfn,
         matnr TYPE eban-matnr,
         txz01 TYPE eban-txz01,
   END OF lnalv_type.


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


I've get the materials from EBAN table.


SELECT * FROM eban INTO wa_eban.
     MOVE-CORRESPONDING wa_eban TO wa_itab01.
     APPEND wa_itab01 TO itab01.
   ENDSELECT.


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


But I don't know how to show the MATNR number at the top of the page. I can activate de report but the line of the material number doesn't show:


FORM top-of-page.
*ALV Header declarations
   DATA: t_header TYPE slis_t_listheader,
         wa_header TYPE slis_listheader,
         wa_matnr TYPE eban,
         t_line LIKE wa_header-info,
         ld_lines TYPE i,
         ld_linesc(10) TYPE c.

* Header Title
   wa_header-typ  = 'H'.
   wa_header-info = 'Relación Material Específico'.
   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.

*Material Number
   wa_header-typ = 'S'.
   wa_header-key = 'Material específico'.
   SELECT matnr FROM eban INTO wa_matnr
     WHERE banfn = pm_banfn.
     ENDSELECT.
   APPEND wa_matnr TO t_header.
   CLEAR: wa_matnr.


   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
     EXPORTING
       it_list_commentary = t_header.
ENDFORM.                    "top-of-page


ALV.jpg

Thanks.


Regards.

Data is not getting displayed for a field in Script form

$
0
0

Hi All,

 

I am new to sap abap. I have done a sample script form and I got the output but data is not displayed for few fields in the script form. Not sure why, I have opened the debugger yet not sure how to analyze it. Please see the following screen shots and help me in finding the issue.

 

I have checked if the data exists for those fields in the database and I found the data for those fields in the sap database.

 

Any help on this will be much appreciated.

 

Thanks,

Macky.

List of vendors having more than one address in SAP ABAP

$
0
0

Hi Team,

 

I am creating a report, my requirement is to get the list of vendors who have more than one address maintained in the sap system. Could anyone of you guys can help me. ?

 

Regards,

Kushi

How to use sys-langu in view definition as condition

$
0
0

Hello, I'm creating a new SAP query and I'm new to SAP, ABAP.

 

End user want to search by MAKT-MAKTX.

But when I use TEXT_MARA_MATNR which is automatically recognized item, SAP query is always time out.

 

So I want to make a view based on MAKT, join it with MARA and use the text field as selection item.
But I could not use SYS-LANGU in where clause in view definition, the view can not verificate.(I could use fixed character like 'E' for EN or 'J' for JP...)

 

Am I doing in the wrong way?

I would appliciate any information.

component created with the same values evry time

$
0
0

hi,

i am using  BAPI_ALM_ORDER_MAINTAIN  to create component for service order

it creates component correctly but it put material and quantity with the same value .

ex: first component : material : A   , QTY : 8

second component : material :b     ,QTY : 6

RESULT IS

 

first component : material : A   , QTY : 8

second component material :A     ,QTY : 8

 

could  you hep me?

 

 

LOOP AT  COMPONENETS INTO WA_COMPONENETS.
wa_methods-refnumber  = '000001'.                    " Component - 1
     wa_methods-objecttype = 'COMPONENT'.
     wa_methods-method     = 'CREATE'.
     wa_methods-objectkey  = ORDERNO.
     append wa_methods to it_methods.
     clear wa_methods.


     wa_component-ACTIVITY                      = '0010'.
     wa_component-material                      = WA_COMPONENETS-COMPONENT.
     Wa_component-item_cat                      = 'L'.
     wa_component-unload_pt                     = 'test'.
     wa_component-requirement_quantity          WA_COMPONENETS-QTY.
*    wa_component-planT          = 'BC20'.
     wa_component-planT          = PLANT.
   append wa_component to it_component.
CLEAR WA_COMPONENETS.
ENDLOOP.

Accessing ABAP list/basic list of background program

$
0
0

Hi,
I have created zprogram, in that i'm calling background program "RKO7CJ8G".


now it displays list. i wanted to acess this basic list/ALV list and tried FM: REUSE_ALV_LIST_DISPLAY. but this gives me
"Field catalog not found" error

 

i have below code:  please let me know if this the correct way to get the list. i wanted to get the error messages of the displayed list.


DATA: I_BAL_S_DMSG TYPE STANDARD TABLE OF BAL_S_DMSG INITIAL SIZE 0.


  SUBMIT RKO7CJ8G
    WITH kokrs    EQ 'WEC0'
    WITH variant  EQ p_varint-low
    WITH perio    EQ p_perio
    WITH gjahr    EQ p_gjahr
    WITH vaart    EQ p_vaart
    WITH testlauf EQ p_testlf
    WITH buperio  EQ p_buperi
    WITH budat    EQ p_budat
    WITH bzdat    EQ p_bzdat
    WITH tdcheck  EQ p_tdchek
    WITH list     EQ p_detlls
*   EXPORTING LIST TO MEMORY
    AND RETURN.
  COMMIT WORK AND WAIT.
  SKIP.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM             = SY-REPID
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER        =
*     ES_EXIT_CAUSED_BY_USER         =
    TABLES
      T_OUTTAB                       = I_BAL_S_DMSG[]
*   EXCEPTIONS
*     PROGRAM_ERROR                  = 1
*     OTHERS                         = 2
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

 

 

once i execute above program i have below screen displayed and i want to access: those displayed messages.

 

Messages displayed.jpg


How to execute frontend command from ABAP and get output?

$
0
0

Hello,

 

I am in desperate need of some help. What I'd like to do is execute a command in client computer, and then import resulting command line output back into SAP. I know I can use FRONTEND_SERVICES=>EXECUTE for simple command executions but it doesn't allow me to import the resulting output. Does there exist a function module that can achieve this or should I just run the command so that the output is written to a file and then this file will be imported to SAP?

Copying Standard Transaction (MM01) to a Z Transaction (ZMM01)

$
0
0

Hi guys. I have a question regarding the topic mentioned in the header.

Our customer wants a copy of Transaction MM01 in order to make some changes (e.g. adding a customized number to material, etc.) and accelerate copying materials. The big point in this is: MM01 should remain unchanged so the functionality of MM01 should remain the same! Hence BADI implementation or user exits are off the cards.

 

However my question now is if this is generally possible and if yes how. Because i tried to copy the underlying program of MM01 which results in an error and also if i just copy the Transaction (in SE93) it says that there is an error "the transactioncode ZMM01 is missing in table T130M". However i do not want to make any changes to this table though but what i want is to simply copy the program of MM01 with all Dynpros etc and make changes in the respective places in order to achieve the result which is expected by the customer.

 

And please do not ask questions regarding "why?" or questioning the meaningfulness of that 'project', please just try to help me fixing that problem or at least give me some hints to another solution (if there is any, I dont think so)..

 

 

Thanks in advance!!

 

Regards Patrick

Smartform - Debit note

$
0
0

i need to make a smartform for debit note. this smartform will be assigned to output type for VF02 T-code. Can any one tell me how can I pull the document number fro VF02 t-code, because on the basis of this doc number i will fetch data and display it in smartform.

purchanse order number not coming on the delivery note

$
0
0

Hello Friends,

 

I was creating delivery note from standard vl02n tcode and using standard smart form but if delivery is created from multiple orders then :

in case of sales order all the order no. are coming on delivery note at item level.

but in case of purchase order order no. are not coming on delivery note at item level

 

 

For header level and single order everything is fine but this is the case with multiple order single delivery.

 

 

Please help ...

Thanks in advance

Ashutosh

How to call Logo in smartform using SO10 Text

$
0
0

hi Experts,

 

I have requirement to call Logo in smartform using SO10 text.

 

To achieve this,

1) I created 1 standard text in SO10 and include my Logo in this Text.

2) After Saving this.

3) I added up 1 text in smartform and change type to Include Text

4) I added the Standard Text which I created in SO10 to Smartform.

 

My issue is when I am calling Smartform, Logo in this text is not displaying, only the hardcoded text is getting displayed.

 

please guide.

 

-Regards

Rohit

Viewing all 8332 articles
Browse latest View live


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