Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all 10425 articles
Browse latest View live

Re: what is use of zsparams

$
0
0

Hi Nikita,

 

As this is a 'Z' table, this means that this was created by a developer and not provided by SAP. Since this might be a part of custom requirement, we can not comment on the table. But yes, if that is being used in multiple programs(doing some comparisons) indicates that this could be one of the configuration data tables that is generally carrying 'hard coded' data which we try to avoid writing in code.

For any further details you can check the ATTRIBUTES, DOCUMENTATION of the table or programs and also you can find the SAP-IDs of the programmers and contact them.

 

Hope this helps you in some way.

 

Regards,

Deepak.


Re: How to retrive the Current Month and Previous Month data from table

$
0
0

Hi,

 

Please change the AND condition in this where clause to OR 'and monat eq p_monat  and monat eq g_previous_month'

 

like :

and ( monat eq p_monat  OR monat eq g_previous_month )

 

This should work as expected.

 

Regards,

Deepak.

Re: Function Module issue

$
0
0

Hi Uppa,

             Thax for reply Sir  will u plz explain how to assigned the value in the a_table....appreciate ur help

Re: characteristic on BAPI_CUSTOMERRETURN_CREATE

$
0
0

Dear Venugopal,

 

thanks for your kind and quick reply. Unfortunately in my SAP the documentation is not available for that BAPI

 

Alessandro

Re: Function Module issue

$
0
0

Hi Happy,

 

You shouldn't declare variables of same name in a Function Module,

Here you are Declaring ITAB_TABLE as Exporting Parameter as well as Local Table, so You should change name of any one

 

You can solve your second problem of Data not getting filled by doing as below code

 

DATA : itab_temp LIKE kna1 OCCURS 0 WITH HEADER LINE.

 

SELECT SINGLE *

     FROM kan1

          INTO itab_temp

               WHERE kunnr = cust_no.

 

itab_table = itab_temp.

 

Or you can even Directly use ITAB_TABLE in the select statement, This will Solve your Problem

 

Thanks and Regards,

Pratheek

Re: Function Module issue

$
0
0

HI happy,

           

            In export parameter u have declared itab_table right,

           that is not a internal table that is work area

            u have to define Itab_table in tables Tab.

 

         follow this logic

       

 

import.JPG

table.JPG

 

code.JPG

write the code in source Code.

 

select * from kna1 into TABLE itab

             where kunnr = cust_no and

             name1 = name and

             land1 = countryname.

 

output:

 

input123.JPG

   after executing u will recieve detail in ti internal table..

 

outt.JPG


output123.JPG

Award points if useful

 

regards,

arun prasath

Re: Exits to populate vendor in purcahsing data tab of an item in IW32

$
0
0

Hi,

 

Following BADI's are available, try implementing them

 

WORKORDER_UPDATE

IWO1_PREQ_BADI

IWO1_WKCTR_CHANGE

 

Thanks

VInay

Re: Function Module issue

$
0
0

Hi Happy,

While building a function module you need to keep at least the following things in mind:

1) Import parameters: Those variables for which values will be provided at the time of calling the function module.

2) Export parameters: Those variables for which values will be populated and produced as output from the Function Module.

 

So while defining a new FM, if you have already provided ITAB_TABLE in the export parameter, that means it is already declared. You dont need to re-declare it inside the source code once again.

 

This is why you were getting the error as: "ITAB_TABLE" is already in use.

 

In the 2nd case, you declared the table A_TABLE in the source code but you have not given it in the export parameters. FM only shows the export and tables parameters containing outputs after executing.

 

So here the basic idea is,

Just declare the variable (internal table in your case) inside the export parameter (dont declare it once again in the source code) and then just write the select statement as you did in the source code.

 

Hope this helps.


Prob with Update BOM ?

$
0
0

Hi ,

I'm working on BOM Update with the following BPAI's, while maintaining im getting error...,

 

Please check my sample code...

 

 

PARAMETERS : p_matnr  LIKE mara-matnr,

             p_plant  LIKE marc-werks,

             p_bomusg LIKE mast-stlan,

             p_altbom LIKE mast-stlal,

             p_idnrk TYPE stpo-idnrk,

             p_vald4m LIKE csap_mbom-datuv.

 

 

DATA:        l_stko    LIKE  stko_api02,

             l_warning TYPE  capiflag-flwarning,

             l_stpo    LIKE  TABLE OF   STPO_API02,

             e_stpo    LIKE STPO_API02,

             l_matnar  TYPE csap_mbom-matnr,

             l_msg     TYPE msg.

 

 

DATA : wa_stko TYPE stko_api02,

       wa_stpo TYPE stpo_api02.

 

 

CLEAR : l_stko, l_stpo.

REFRESH l_stpo.

 

 

l_matnar = p_matnr.

 

 

CALL FUNCTION 'CSAP_MAT_BOM_OPEN'

  EXPORTING

    material   = l_matnar

    plant      = p_plant

    bom_usage  = p_bomusg

    valid_from = p_vald4m

  IMPORTING

    o_stko     = l_stko

    fl_warning = l_warning

  TABLES

    t_stpo     = l_stpo

  EXCEPTIONS

    error      = 1.

IF sy-subrc <> 0.

  CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

      id     = sy-msgid

      lang   = sy-langu

      no     = sy-msgno

      v1     = sy-msgv1

      v2     = sy-msgv2

      v3     = sy-msgv3

      v4     = sy-msgv4

    IMPORTING

      msg    = l_msg

    EXCEPTIONS

      OTHERS = 0.

  IF sy-msgty = 'E'.

    WRITE : l_msg.

  ENDIF.

ENDIF.

 

 

 

 

LOOP AT l_stpo INTO wa_stpo.

wa_stpo-CHANGED_ON = sy-datum.

wa_stpo-CHANGED_BY = sy-uname.

wa_stpo-component = p_idnrk.

wa_stpo-comp_qty = '991111'.

wa_stpo-valid_to = '31.12.9999'.

wa_stpo-change_no = wa_stpo-change_no + 1.

 

 

  CALL FUNCTION 'CSAP_BOM_ITEM_MAINTAIN'

    EXPORTING

      i_stpo     = wa_stpo

    IMPORTING

      o_stpo     = wa_stpo

      fl_warning = l_warning

    EXCEPTIONS

      error      = 1

      OTHERS     = 2.

  IF sy-subrc <> 0.

  ENDIF.

  ENDLOOP.

 

 

*Close and COMMIT

  CALL FUNCTION 'CSAP_MAT_BOM_CLOSE'

    EXPORTING

      fl_commit_and_wait = 'X'

    IMPORTING

      fl_warning         = l_warning

    EXCEPTIONS

      error              = 1

      OTHERS             = 2.

  IF sy-subrc <> 0.

  ENDIF.

 

 

 

Please suggest me what is going wrong....,

 

 

Regards,

Lokesh.

Re: what is use of zsparams

$
0
0

Hi Nikita,

 

I assume you are new to SAP, In SAP all the Tables Classes and Other Objects which start with a Letter A-X Belongs to SAP, and Y-Z is for Customer.

 

There may be many functionality that you require when you are programming in ABAP, these common functionality are created by SAP and are given to customer, even then requirements may vary from customer to customer, this is where you need to create your own Reports Tables etc..

 

So to differentiate between between customer created Objects and Standard SAP Objects SAP has provided separate namespace for Customers this is Y and Z

 

So the table you mentioned here starts with Z which means it is not created by SAP, it was created by a developer for some specific requirement.

 

Thanks and Regards

Pratheek

Re: What is wrong with these statements

$
0
0

Blue,

 

Whenever you declare an event block such as INITIALIZATION, START-OF-SELECTION, or AT SELECTION-SCREEN [ON...] you are ending the previous event block.  The compiler expects all IF and LOOP statements to have their corresponding END statements when a new event block is defined.

 

In your case, you could just remove the IF-ELSE-ENDIF block and things will work fine.

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SERVER.
     PERFORM GET_VALUE_FILENAME USING 'SERVER' SERVER.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR LOCAL.
     PERFORM GET_VALUE_FILENAME USING 'LOCAL' LOCAL.

 

 

If you want to disable the value-help for local when SERVER is 'X' and vice versa, you could add this to your code:

 

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SERVER.

      CHECK server = 'X'.

      PERFORM GET_VALUE_FILENAME USING 'SERVER' SERVER.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR LOCAL.

     CHECK server = space.

     PERFORM GET_VALUE_FILENAME USING 'LOCAL' LOCAL.

If the logical expression in the CHECK statement evaluates to false, the event block will be exited before the subroutine can be called.

Best,

  Eric

Re: Changing VAT number on Billing Document Header

$
0
0

Hi Bert,

 

Please go through BadI mention below. I have got this on the "Goto" > Header > Header Screen.

 

BADI_SD_CUST_HEAD

 

Please let me know if this is not useful.

 

Thanks.

Re: inheritance problem in oo programming

$
0
0

what if I need more parameters in the method in subclass than in the superclass?

I will be very appreciate if you give me some guides of how to use

"CALL METHOD super->display_value" in the redefinition of display_value in subclass.

Re: Multiple Batch Job Fail - Debugging

$
0
0

Select the job and then go to display job log(CTRL+SHIFT+F11). Once you are in the job log go to System->List->Save->Local File. You will get a pop-up asking you to specify the format in which you want to save. Select unconverted, give it a destination and a file name and you should be able to download the job log..

Re: SMARTFORMS

$
0
0

Happy,

 

You're almost there, you just need to call a second FM.  The FM 'SSF_FUNCTION_MODULE_NAME' does not print the smartform.  It returns the name of the FM that will print the smartform, data type rs381_fnam.  There is no difference between FM_NAME or FNAME, you can call the variable whatever you want.

 

Try this code:

 

 

TABLES : MARA.

 

DATA : ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.

 

* Add this variable, it's the name of the FM to call

DATA:  G_FM_NAME TYPE RS381_FNAM. 

 

SELECT-OPTIONS : MATERIAL FOR MARA-MATNR.

 

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR IN MATERIAL.

 

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

  EXPORTING

    FORMNAME                 = 'ZSFORM_HAPPY'

*   VARIANT                  = ' '

*   DIRECT_CALL              = ' '

IMPORTING

   FM_NAME                  = G_FM_NAME "Make sure and uncomment this!

* EXCEPTIONS

*   NO_FORM                  = 1

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

 

*This is the Second FM Call

CALL FUNCTION G_FM_NAME

  EXPORTING "Add the parameters of your smartform here

  TABLES "Add table parameters if you have them

*  EXCEPTIONS "Add exceptions if you want

.

 

 

This will print the smartform.

 

Best,

Eric


Re: can anybody tell me what is the exact way of debugging a smart form in production server?

$
0
0

Go to transaction SMARTFORMS, put in the name of the smartform you want to debug. Then on the menu go to Smart Forms->Test.

 

It will redirect to t-code SE37 with a function module name already filled in. This FM is the one which will call your smartform in the background. Display the code for the FM and you can have a break point in that function module.

 

You can run the transaction(example ME21N for creating a PO) for which the output is being generated via the smartform and it will stop at your break point.

Re: can anybody tell me what is the exact way of debugging a smart form in production server?

$
0
0

Hi,

 

In order to debug a smart form u can do as follow.

First keep a hard code break point.

run the driver program,when it enters into debugging.

goto switch to classical debugger and the goto settings select update debugging .

then where u have keep the break point it will stop.

 

 

sftrace is also in identifying some errors like quantity/currency fields refernce field is missing and so on.

 

for this goto tcode: SFTRACE

Then click switch on trace

and execute ur prgm after completely executed ur prgm

again got sftrace and stop trace

in the bottm u got the errors which u got during process.

select and click display button.

 

That's all

Re: Multiple Batch Job Fail - Debugging

$
0
0

Hi Aneesh - i've tried that...

 

but i have 267 jobs that failed... I want to mass extract the job logs for each.

 

 

not drill into them one at a time.

 

Shane

Re: Multiple Batch Job Fail - Debugging

$
0
0

You can read a batch log programatically using BP_JOBLOG_READ. There are other FMs for manipulating batch jobs. So you could write a program using these.

Re: Problem with SAP QuickViewer SQVI

$
0
0

Make sure you connect KNBK to KNA1 using a "left outer join", right click on the link to change the join type.

Look for available information on inner and outer joins to understand the difference.


Thomas

Viewing all 10425 articles
Browse latest View live


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