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

t code for invoice create

$
0
0

Hi

 

can anybody tell me the T code for invoice create


Function Module to convert Days into Months or years

$
0
0

Hello...

 

Could any one please help me to convert  no of days into month or year format using

funciton module. i have read blog there are  many date function modules are there which

consider two reference date as importing parameters. as per my requirement i need FM which has

Days as importing parameter and month and year are  exporting parameters.

 

Awaiting for your suggestion.

Nishi

What does error message 'Balance in Transaction Currency' while i am checking document USING BAPI_ACC_DOUCMENT_CHECK.

$
0
0

What does error message 'Balance in Transaction Currency' while i am checking document USING BAPI_ACC_DOUCMENT_CHECK.

how to edit tmg on custom table

$
0
0

hi experts,

 

i still in not getting my requirement i have to submit my work , i request u all to fine solution for this o/p

Field 1Field 2Field 3Field 4
XDisable
XDisable
XXDisableDisable

 

this should be done in tmg so help me out with code

 

thanks

how to write bdc program in sap abap

$
0
0

how to wrtite bdc program in sap abap

How to add components to selection screen generated from logical database ADA?

$
0
0

Hey gurus,

 

I have a program using logical database ADA, which have the following selection screen generated automatically because of this code

 

TABLES: anla0,

         anlb,

         anlav,

         v_anepk,

         bkpf,

         anlz,

         anlcv,

         cdhdr,

         cdpos,

         dd03l,

         dd04t,

         anep,

         tabwt.

sap.png

I would like to populate this selection screen with my own components where the red line is. Is it somehow possible to do it thru the code? If I make some parameters it is added to the bottom of the screen but I need to put it where the red line is.
Or the only option here is the screen painter?

 

Regards,
Robert

Runtime Error "DBIF_RSQL_INVALID_RSQL"

$
0
0

Dear All,

 

When I select   S031 table for  Opening and closing against Material and plant.

in that time query given short dump. Please help how to resolve this Issue.

 

Code :

SELECT matnr mtart meins spart thicknes other FROM mara INTO TABLE it_mara

   WHERE matnr  NOT IN L_R_MAT AND mtart = 'FERT'  AND spart  IN s_div.

 

RANGES: l_matnr FOR mara-matnr.

 

     l_matnr-sign = 'I'.

     l_matnr-option = 'EQ'.

 

     LOOP AT it_mara INTO wa_mara.

       l_matnr-low = wa_mara-matnr.

       APPEND l_matnr.

     ENDLOOP.

 

SELECT s031~werks

            s031~matnr

            s031~lgort

            SUM( s031~mzubb ) AS rcptqty

            SUM( s031~wzubb ) AS rcptval

            SUM( s031~magbb ) AS issuqty

            SUM( s031~wagbb ) AS issuval

       INTO CORRESPONDING FIELDS OF TABLE gt_rcptissu

       FROM s031

      WHERE s031~ssour = ' '

        AND s031~vrsio = '000'

        AND s031~spmon < s_spmon-low

        AND s031~sptag = '00000000'

        AND s031~spwoc = '000000'

        AND s031~spbup = '000000'

        AND s031~werks IN  s_werks

        AND ( matnr IN l_matnr )

         GROUP BY

            s031~werks

            s031~matnr

            s031~lgort.

 

 

Regards

Chandan

Data Archive for Customised Table

$
0
0

Dear All,

 

My requirement is to archive data to ADK file according to date selection and retention time is 6 years. ALV report should fetch data from Ztable and also from archived file as per date selection. I have created one Archive Object.

I have some questions:

1. what are the actual steps and prerequisite to archive data for customized table?

2. how to create content repository for data archive?

3. For write and delete program which function modules are to be used? 

4. Do i need to create new Logical file or I can use standard file ARCHIVE_DATA_FILE.

 

regards,

Mahadeo

 

 


BTE Error

$
0
0

Hi Experts,

                 I have faced a problem regarding BTE of FBL3N.Here I have done the coding regarding customer no. and customer name in the function module.The code is triggered when I am executing the tcode FBL3N.But when I am going to execute it background.Then I am going to tcode SM37 and find that the customer no. and customer name column is blank.Please advice.

 

 

I have illustrated the code which I have written in the function module ::

 

IF sy-tcode ='FBL3N'.

CLEAR : bseg.

SELECT SINGLE *

FROM bseg

WHERE bukrs = i_postab-bukrs

AND belnr = i_postab-belnr

AND gjahr = i_postab-gjahr

AND koart = 'K' .       "and lifnr = i_postab-konto.

IF sy-subrc EQ 0.

e_postab-Zlifnr = bseg-lifnr.

CLEAR: lfa1.

SELECT SINGLE *

FROM lfa1

WHERE lifnr = bseg-lifnr.

IF sy-subrc EQ 0.

e_postab-Znamek = lfa1-name1.

ENDIF.

ENDIF.

CLEAR : bseg.

SELECT SINGLE *

FROM bseg

WHERE bukrs = i_postab-bukrs

AND belnr = i_postab-belnr

AND gjahr = i_postab-gjahr

AND koart = 'D'.                " and kunnr = i_postab-konto.

IF sy-subrc EQ 0.

e_postab-Zkunnr = bseg-kunnr.

CLEAR: kna1.

SELECT SINGLE *

FROM kna1

WHERE kunnr = bseg-kunnr.

IF sy-subrc EQ 0.

e_postab-Znamed = kna1-name1.

ENDIF.

ENDIF.

ENDIF.

Attach the XML file from application server to the purchaseorder via GOS in background and stoes the attachment in SAP DB archive link in Kpro

$
0
0

Hi Abap Experts,

 

I have one requirement to create the xml attachment in the purchase order via GOS from the application server  and stores the attachment in SAP DB archive link - which is working in foreground mode from the PC for the xml file attachment  but I need to from the application server -xml file attach in PO via GOS and stores in SAP DB via Kpro instead of PC.

 

It is very urgent.Kindly provide some sample code or some BAPI or FM or method can be used in background case.

 

One clarification-Is it required always file path to attach the xml file for the  storing in sap DB table archive link or only I can pass the File contents and it will do the further work by the standard FM or BAPI.

 

 

Thanks in advance.

 

Thanks and Regards,

HP

differentiate select queries in abap

$
0
0

when we use select single and select single * and up to 1 rows?please give example and syntax?

what is the purpose of for all entries?

how to use commit and roll back in bapi in same program?

$
0
0

Hi Experts,

i have requirements like update sales order data using bapi

 

if any errors occurs in those i want to roll back them and rest of them i need to update...

 

how can i achieve these....

in which order i need use both commit and roll back in bapi

 

 

@moderators

 

before closing any content please tell me right path for getting the solution....................................

 

you people are simply closing the content with out explaining solution.

 

we are here for try to get solution for our problem.................

 

dont kill our oppurtunities..........

change table value

$
0
0

Hello experts,

 

I handle SD instead of ABAP. However I got some questions related to ABAP. Pls help. Thanks.

 

Q1. Is it possible to change the value in field KOSTL of table LIPS? For e.g. KOSTL shows 123, any chance to change it to 456?

 

Q2. If the answer for Q1 is yes, how to change it, e.g. which Tcode, what is the process steps?

 

Q3. What is the impact for this kind of change?

call transaction 'VA01' -> long texts

$
0
0

Hi,

 

requested feature: code a batch input, that fills a bunch of fields in transaction VA01, including some long texts (goto -> header -> text) and let the batch input stop, BEFORE saving the order. the user has to press the save-button, after he has checked the contents.

 

problem: the long text name is the order no - which I do not have before saving the order, AND: the long texts control in VA01 is not batchable, and even it would be, I don't want to batch input long texts. how can I trick the VA01 into writing the long texts into the (still unsaved!) order?

 

Our SD user exists are full of coding, so I don't want to extend a user exit (because this would cause many tests).

 

Thanks

 

Ralf

Swapping Rows and Columns

$
0
0

Hi Gurus,

   First let me apologize if this is a silly question, I am very new to programming and ABAP. I am having difficulty with a program for my company and could use some hand holding ,  I basically need to swap my output rows and columns. I need  my inormation (Totals) to go vertical not horizontal. I need my columns horizontal. at least be displayed this way.   I am not sure if I would do this in the program or just in the output using (ALV I think ). I need a little hand holding here


My output is the first sample normal output is the second Could REALLY  use some help. THAN YOU

Capture3.JPG

Capture3.JPG

Moderator message - "Hand holding", "Spoon feeding" are not allowed in the forums. Please read the rules of engagement before posting your question.

 

Message was edited by: Suhas Saha


Can we connect to another server?

$
0
0

hi, while creating table maintenance generator i want to connect to another server how to achieve this ?

 

thanks in advance

 

 

Regards

Reddy

ENCO tcode to allow user to change field value while printing smartform

$
0
0


Hi all,

 

    I have a custom smartform and what i want is that few selected fields of the smartforms should be amendable (ie their values should be allowed to modify by the user while printing the smartform). How to make this possible. I have heard that using ENCO tcode this requirement can be fulfilled. But I am not able to get any details on the ENCO tcode and the configuraton required for this.

 

Any help will be appreciated???

 

Thanks

Error displaying date as column header in RTTS

$
0
0

Hi Alli,

   I have an output where I am using a sate for the column header in RTTS as below. I am getting a short dump when I get to line gr_struct_type ?= cl_abap_structdescr=>create(p_components = gt_component)  I  have tried making the field a Character, Sy-DATUM and Number. The dump states component name '02012015' of the component 2  contains an illegal character. I do not need the display format as I can change it before output, though that would be easier if it could be entered initiallly as is.

 

 

Capture 5.JPGCapture 5.JPG

I am working around this at the moment by formatting the date in my column output. Also to give my rows actual names the only solution I could think of was to make a field called with my row names in it. So in this case Field = "Total Sales" is there a cleaner solution?

 

Thanks,GeorgeCapture 5.JPG

Module pool programming for ABAP Beginners

$
0
0

Module Pool Programming

 

 

Introduction to MPP

  • A module pool is a collection of screens, flow logic, menu bars and ABAP code that when linked together build an application.
  • Through MPP there is a two way communication with the database.
  • Typically the transaction code that calls the application will refer to the module pool and the initial screen number.
  • These are the type M programs in SAP.
  • Also referred to as Dialog Programs as they cannot be executed in background.

Reports Vs Dialog Programs


          Reports

            Dialog Programs
A report is a program that typically reads and analyzes data in database tables without changing the database.A dialog program allows you to work interactively with the system and to change the contents of the database tables. Each dialog program has a certain sequence of screens that are processed by the system one after the other.
A report could run directly as well as by creating a transactionFor executing dialog programs we need to create a z transaction.
Reports are type ‘E’ (Executable) SAP ABAP ProgramsDialog Programs are type ‘M’ (Module) SAPPrograms
The screen sequence is controlled by events, which occur in a fixed order.We can program screens to appear in any sequence we want

Dialog Program Components

SAP Transaction

  • The transaction code starts a screen sequence.
  • Transaction codes could be created in the Repository Browser in the ABAP Workbench or using Transaction SE93.
  • A transaction code is linked to an ABAP program and an initial screen.
  • We can start a screen sequence from any ABAP program using the CALL SCREEN statement.

Screens

  • Each dialog in an SAP system is controlled by one or more screens.
  • You create screens using the Screen Painter in the ABAP Workbench through transaction SE51
  • Each screen belongs to an ABAP program.
  • These screens consist of a “screen mask” or “layout” and its flow logic. The screen has a layout that determines the positions of input/output fields and other graphical elements such as checkboxes and radio buttons. A flow logic determines the logical processing within screen.

Flow Logic

  • Process Before Output After it has processed all of the modules in the PBO processing block, the system copies the contents of the fields in the ABAP work area to their corresponding fields in the screen work.
  • Process After Input(PAI) Before it processes the first module in the PAI processing block, the system copies the contents of the fields in the screen work area to their corresponding fields in the ABAP work area.
  • Process on help request (POH) It is processed when F1 key is pressed. It is used to provide the documentation help to the user. 
  • Process on value request (POV) It is processed when F4 key is pressed. It is used to provide the value input help to the user for entering data on screen.

ABAP Program

  • Each screen and GUI status in the R/3 System belongs to one ABAP program.
  • The ABAP program contains the dialog modules that are called by the screen flow logic, and also process the user input from the GUI status.
  • ABAP programs that use screens are also known as dialog programs.
  • —In a module pool (type M program); the first processing block to be called is always a dialog module. However, you can also use screens in other ABAP programs, such as executable programs or function modules. The first processing block is then called differently; for example, by the runtime environment or a procedure call. The screen sequence is then started using the CALL SCREEN statement.

GUI Status

Each screen has a GUI status. This controls the menu bars, standard toolbar, and application toolbar, with which the user can choose functions in the application. Like screens, GUI statuses are independent components of an ABAP program. You create them in the ABAP Workbench using the Menu Painter(SE41) .

 

Dynpro

  • A screen together with its Flow logic is called a Dynpro (“Dynamic Program” since the screen flow logic influences the program flow).
  • —Each dynpro controls exactly one step of your Dialog Program.
  • The screens belonging to a program are numbered. The screen flow sequence can be either linear or cyclic. From within a screen chain, you can even call another screen chain and, after processing it, return to the original chain. You can also override the statically-defined next screen from within the dialog modules of the ABAP program.

ABAP Module Pool

  • On a PBO or PAI event a Dynpro calls an ABAP dialog program. Collection of such programs is called the ABAP module pool.
    —For example modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
  • —All Dynpro to be called from within one transaction refer to a common module pool.

User Input Checking

  • Using FIELD Statement: If you want to check input values in the module pool and start dialog in the event of a negative result, you use the FIELD statement with the addition MODULE.If the module results in an error(E) or warning(W) message, the screen is redisplayed without processing the PBO modules. The message text is displayed and only the field being checked by this module becomes ready for input again.
    Eg. FIELD MATNR MODULE user_command_0100
  • Using Chain Statement: If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    —CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>....
    ENDCHAIN.

    All of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.

    SAP Standards for MPP

    • All MPP program names should start with SAPMZ

    Leaving a Screen from a Program

    In a program, you can use one of the two following ABAP statements to leave a screen:
    LEAVE SCREEN.
    or
    LEAVE TO SCREEN <next screen>.

    The LEAVE SCREEN statement ends the current screen and calls the subsequent screen. The next screen is either the static next screen or a dynamic next screen. In the second case, you must override the static next screen using the SET SCREEN statement before the LEAVE SCREEN statement.

    SET SCREEN <next screen number>.
    LEAVE SCREEN.

    The LEAVE TO SCREEN statement exits the current screen and calls the dynamic next screen, which you specify as part of the statement. The LEAVE TO SCREEN statement is no more than a contraction of the two statements —These statementsdo not end the screen sequence. They merely branch to another screen in the same sequence. The screen sequence only ends when you leave to next screen 0.

    Call Screen:- This statement calls the dynpro with the dynpro number specified in dynnr. For dynnr, a data object of type n and length 4 is expected. The call starts a new dynpro sequence, which is embedded into the current dynpro sequence. The dynpro with dynpro number dynnr is the initial dynpro of the dynpro sequence. In a dynpro sequence started by a transaction code, you can nest up to 50 other dynpro sequences.
    Syntax
    CALL SCREEN dynnr [STARTING AT col1 lin1 [ENDING AT col2 lin2]].

     

    • —Include TOP:- Include type program where all the data declaration is made.
    • —Include 001:- Include where all the PBO Modules are declared.
    • —Include I01 :- Include where all the PAI Modules are declared.
    • —Include F01 :- Include where all the Form routines are declared.

BAPI to Create Sales Order with Characteristics

$
0
0

Peace be Upon you all,

 

I was using a report that uses BAPI FM :  BAPI_SALESORDER_CREATEFROMDAT2

to create Sales orders,

 

the SD Team are using Characteristics (Item Details: Configuration)

about 10 characteristics (Width, Thickness, Quality, ...)

 

so, my task now is to add the ability to create Sales Orders with these Characteristics from the same report

those characteristics are located in an internal table in my report,

 

I've been searching but couldn't find any post with clear clarification and description ..

 

everyone is giving examples only

and when I used these examples .. the Sales Orders were created without Characteristics

 

I need to now exactly ..

what are the internal Tables that I MUST populate in this BAPI ? and which fields ?

 

can I populate ORDER_CFGS_VALUE only ?

 

 

please advise me

 

Thank you

Viewing all 8332 articles
Browse latest View live


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