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

FM or BAPI to Close Orders (CLSD)

$
0
0

Hello all,

 

Can anyone suggest FM (or FMs) to close (business complete-CLSD) PM orders?

 

We need to close some orders (business complete-CLSD, and technically complete-TECO) and ensure that tables AUFK and VIAUFKS are being updated.

 

The FM 'BAPI_ALM_ORDER_MAINTAIN' worked for system status TECO but we cannot get it to work for status CLSD.

 

Thanks,

Smeeta


ABAP - END-OF-SELECTION

$
0
0

select statements are used at start- of selection event. but if we use select statement at end of selection statement then what is the output?

The use of Start-of-Selection is to fetch the

data from the database. and end of selection statement are used in HR - abap codes for printing the output, processing and formating the data stored in sequential data sets i.e. in internal tables.

 

Moderator message - Please read the available documentation.

 

Message was edited by: Suhas Saha

getting confusion regarding screen exit

$
0
0

how can i get add my fields in VA21 application???

 

There is no screen exit,but i have found many function exits for VA21 application...please send me reply

About printing: WRITE causes a line feed. How to prevent this ?

$
0
0

Hello SDN members,
I have a technical question about printing. Because of a very special project I need to send data to label printers via SAP spool. Smartforms or Adobe Interactive forms are not a possible alternative for us at this moments. We want to embed dynamically some bitmaps. That means, that I have to send data directly in printers language. For this I use a procedure like


NEW-PAGE PRINT ON DESTINATION ...
WRITE ....
WRITE ....
NEW-PAGE PRINT OFF.

 

This report runs for several years. Now we must implenet new fuctionality of printing bitmaps. While implementing this, I recognized that the WRITE command will cut longer data or add a line feed (0x0A) automatically to the output stream if data exeeds a special line length. The new functionality is to print bitmaps, embetted by transaction SE78. For this I have to send the full bitmap data to the printer. Unfortunatly WRITE damages this data stream by inserting line feed.


Example: this is a section of the spool data, copied by CTRL+Y and CTRL+C.

 

{RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,
424D52000000000000003E00000028000000050000        
0005000000010001000000000000000000232E0000        
232E00000000000000000000FFFFFF000000000087}    
{XS;I,0001,0002C5100}{U1;0120}


But I need a "longer" stream without line feeds like this:
                
{RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,424D52000000000000003E000000280000000500000005000000010001000000000000000000232E0000232E00000000000000000000FFFFFF000000000087}
{XS;I,0001,0002C5100}{U1;0120}


I think this is because SAP spool inserts a line feed because of the paper (or list) size.


How can I prevent this ? Other possibilities ?

Here you can see the code snippet


  DATA: lv_sg TYPE string,
        lxstr_data TYPE xstring,
        lstr_data TYPE string,
        lv_max TYPE i,
        lstr_line TYPE string,
        lv_pos TYPE i,
        lv_line_cnt TYPE i.

......
......


* get the bitmap data stream
  CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
    EXPORTING
      p_object       = 'GRAPHICS'
      p_name         = iv_bitmap_name
      p_id           = 'BMAP'
      p_btype        = 'BMON'
    RECEIVING
      p_bmp          = lxstr_data
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.

* convert to string
  lstr_data = lxstr_data.

......
......

  CONCATENATE '{SG;' lv_offx ',' lv_offy ',' lv_sizex ',' lv_sizey ',2,'
    INTO lv_sg.

* send to printer
  write lv_sg.

* send bitmap data
  write lstr_data.

* send terminator to printer
  write '|}'.

 

The Result was a single but cutted data line, like:

 

{RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,424D52000000000000003E0000002800


The cutted part of the stream is lost then. So I tried to separate the data into smaller parts, like this:


******************************
* create header

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

  CONCATENATE '{SG;' lv_offx ',' lv_offy ',' lv_sizex ',' lv_sizey ',2,'
    INTO lv_sg.

* send to printer
  write lv_sg.

 

*******************************
* loop for bitmap data
*******************************

* convert to string
  lstr_data = lxstr_data.

* get length of data
  lv_max = STRLEN( lstr_data ).

* loop about the length        <=this workaround is made to part the full stream into smaller data streams
  DO lv_max TIMES.
    lv_pos = sy-index - 1. "fix the line counter

* add character to line buffer
    CONCATENATE lstr_line lstr_data+lv_pos(1) INTO lstr_line.

* if line buffer > 40
    IF lv_line_cnt > 40.
      lv_line_cnt = 0. "reset line buffer
      write lstr_line . "send line buffer to printer
      CLEAR lstr_line. "clear line buffer
    ELSE.
* increase line buffer counter
      lv_line_cnt = lv_line_cnt + 1.
    ENDIF.

  ENDDO.

 

*******************************
* create terminator

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

* send terminator to printer
  write '|}'.


This leads to the effect, that SAP inserts line feed.

 

Any idea ?!

Thank you for helping me ...

 

Regards,
Markus

F110 - APP - Chque printing on pre-printed stationary.

$
0
0

Hi ,

 

I am printing the Chques on the pre-printed stationary using the Custom  layoutset via F110 for some vendors. This Vendor has 4 open line items.

My Cheque layout is as follows:

 

Window        Element

Details1       HEADER

Details1       DET

Main            MAIN_DET.

Amounts     no element

 

I am making modifications to the RFFOUS_C by copying it to the Z- Custom program and calling my windows and elements using WRITE_FORM at appropritate places. The program is picking up the layoutset and goes to the indiviadual elements as well. But while printing it is not printing the Element 'HEADER' of the window 'Details1'  and out of the 4 open line items it prints only one line item in Window 'Details1' Element 'DET'. Ideally it should print all the 4 open line items in Details1 as well as Main window. Window 'MAIN'  Element 'Main_det' and the window 'Details1' Element  'DET' have the same details.  But Details1 Window and Elements are getting trigggered but not getting printed as a result I get 3 open items printed in Window MAIN and one open item in 'Details1'. This is a very strange behaviour and I have never come across.

 

While calling the Layoutset I am using only Window name and the Element name and not the Function ( SET APPEND )and the other parameters.

 

Can any one please let me know where have I gone wrong. What needs to be done to print all the 4 open line item details in the windows 'MAIN'in and also in the 'Details1' window. So also the Element 'HEADER' gets called but immidiately comes out of the Window in write_form during debugging and hence it is not printed. I want to print the elemnt 'HEADER' also in the printout.

 

Can any one please let me know what needs to be done to print all the open items in both the windows...?

 

Also can I get away with the Z-custom program and use only the Std SAP program(ZRFFOUS_C) to achieve my goals as the FC says without the Custom program one can still achieve once goals.

 

Regards,

Deepak.

What is significance of Quantity field in a secondary index.

$
0
0

Hi,

 

Can we create secondary index with Quantity field like VBAP-ZMENG.

 

Regards,

Shyam.

AS ABAP 7.4 trials as virtual appliances: Questions and feedback

$
0
0

This thread should serve as container for all discussions, questions and feedback concerning the new AS ABAP 7.4 trials provided as virtual appliances by the SAP Cloud Appliance Library. For more information about these trial appliances please visit the corresponding page on SCN.

Adding entries in LFAT for vendor using iDoc

$
0
0

Hi Guru´s

 

Is anyone aware of a possibility to create and change entries in LFAT table using iDocs, such as CREMAS05?

 

Please advise.

 

Kind regards,

Roy


Bapi or FM to create a downpayment document(F-47)

$
0
0

Hi,

 

Need an FM/BAPI to create an down payment document similar to F-47

 

Document type : KA

Spl G/L Acc Indicator : A

Account = Vendor No

 

Regards

Shiva

Alignment in application servre data

$
0
0

Hi Experts,

I am working on a simple program. i need to download the internal table data to UNIX server.

now thing is that i am able to download that data in UNIX server, but the client now wants the data in

alignment like below screen.

 

0-1614976-1       |               |05            |Resistor 100K 2% 1-8W                   |

0-1614979-1       |               |05            |Resistor 10R 2% 1-8W CF               |

0-1614981-1       |               |05            |Resistor 110R 2% 1-8W                   |

0-1622161-1       |               |05            |Resistor 150K 2% 1-8W                   |

0-1622163-1       |               |05            |Resistor 15K 2% 1-8W                    |

 

 

Please help on that matter.

 

Thanks in Advance.

Regards

Rakesh

Badi ME_PROCESS_REQ_CUST Method SET_DATA not updating table

$
0
0

Hi Experts,

 

I am facing difficulty while trying to change BLCKD value on Purchase Requisition creation/change. In debugger value is getting changed but database table is not updating.

 

I have checked much thread but not found anything suitable.

 

Please help me on this.

 

Regards,

Amrendra

 

 

Below code is written on the methods PROCESS_ITEM, POST and CHECK.

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

DATA: I_ITEMS TYPE MMPUR_REQUISITION_ITEMS,
        WA_ITEM
LIKE LINE OF I_ITEMS,
        LV_IF_ITEM
TYPE REF TO IF_PURCHASE_REQUISITION_ITEM,
        LT_ITM_DATA
TYPE MEREQ_ITEM,
        LX_ITM_DATA
TYPE MEREQ_ITEMX.

 
CALL METHOD IM_HEADER->GET_ITEMS
    RECEIVING
      RE_ITEMS = I_ITEMS.


 
LOOP AT I_ITEMS INTO WA_ITEM.

      LV_IF_ITEM = WA_ITEM-ITEM.

     
CALL METHOD LV_IF_ITEM->GET_DATA
        RECEIVING
          RE_DATA = LT_ITM_DATA.

     
CALL METHOD LV_IF_ITEM->GET_DATAX
        RECEIVING
          RE_DATAX = LX_ITM_DATA.

     
IF LT_ITM_DATA-FRGGR IS INITIAL. " If release code is not available


        LX_ITM_DATA-BLCKD =
'X'.

       
CALL METHOD LV_IF_ITEM->SET_DATAX
         
EXPORTING
            IM_DATAX = LX_ITM_DATA.

        LT_ITM_DATA-BLCKD =
'1'.

       
CALL METHOD LV_IF_ITEM->SET_DATA
         
EXPORTING
            IM_DATA = LT_ITM_DATA.

    ENDIF.
  ENDLOOP.

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

Implicit COMMIT WORK in Remotely Called Function

$
0
0

Hello Master,

 

 

I have a question.

 

 

My program is in SSS system and when calling the RFC "ZRFC_TEST" with DESTINATION "DEST_DDD". One implicit COMMIT is performed in my local system (SSS System) and saved the data. Why does this happen?

 

In SSS local system have a validation SY-SUBRC after the RFC call, this validation to control the COMMIT or ROLLBACK.

 

thank for you help.

SRM Purchase Order Form Printing - Adobe Form

$
0
0

Dear SRM Boffins,

 

My client has a requirement to design a new Purchase Order Form in SRM as Adobe Form. I am however having problems to get the correct way of doing this. My questions are as follows:

 

1)      It seems as if you can set the printing programs (in this instance a class and method) in transaction BBP_PO_ACTION_DEF. This transaction           however seem very fixed to force you to use Smartforms (the form name can only be selected from smartform names) .

 

           If you however start investigating the code (Class CL_PD_PO_PROCESSING_BB Method: PPROCESS_BBP_PO_PRN) you can see that           that they check if you have activated a BADI (BBP_PROCESS_PO) where you can write your own code... BUT I cannot see how to trigger the           BADI?! The class CL_PD_PO_PROCESSING_BBP has an attribute SV_BADI_ACTIVE1 but I can see nowhere how to set the value? Has           anyone done this before?

 

2)     My external debugging is setup perfectly and I can debug in SRM, but I am struggling to get the debug to trigger the CL_PD_PO_PROCESSING_BBP class. Has anyone had a problem like this before?

 

Any help would be greatly appreciated!

 

Kind Regards

Deon

FB70-in batch input mode program-background mode

$
0
0

Hi,

 

we are having a requriement to use FB70-customer invoice booking transaction in a BDC Call transaction program, we need to schedule the same in background mode,but the thing is its not getting executed in the background mode.SAP is saying you can not execute the enjoy transaction in any batch input programs in background mode. please help me.here i am attaching the SAP note for your reference.

 

regards,

Satheesh Kumar N

Process Monitor - where are the entries stored in?

$
0
0

Hi Everybody,

 

does anyone of you know in which table the process monitor logs are saved?

 

What I want to do is: My ABAP Programm should be able to save log messages to somewhere, so I can see them in the Process Monitor when I doubleclick on them.

 

Thanks for any help.

Volker


what is sy-ucomm value for save in ca02

$
0
0

hi expert.

i need sy-ucomm value just  for when i click on save .i switched on debuge and i see for  save this value is BU     but when i edit one row on add one row or delete one row exactly this value is bu.

please help me.

Stop writing Technical Documentation nobody will ever read

$
0
0

If you're an ABAP developer, answer me: how many times do you really read the technical documentation of a Z program you're about to change? And for the times you did read the documentation, answer these: was it of any help in understanding what the code is doing? Was the documentation up to date with the source code?

 

In this blog, I'll try to tell you why I think we should get rid of poorly created Technical Documentation (I'll refer to them as "TDs" in this article), and change to a better approach. Many projects I've been in the past can SHIFT+DEL ALL of their TDs, and nobody would ever notice. Here's why.

 

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

 

 

TDs with 10 pages for 500 lines of code

 

First of all, I hate documentation templates. I know why it was created in the first place, but most times that "old word template" is made by someone who knows nothing about code documentation.

 

Why do I have to add field name, description, type and length for every single field of a Z table I created inside a word document? Why do I have to specify all selection screen fields? Why do I have to copy things over from the Functional Specification?

 

Once upon a time I was in a project where we had to create a huge set of Z tables. Me and my ABAP friends had to write down in a word document every single field, description, data type, length, data elements, domains, etc, for every table we created. A huge amount of time lost writing a document that will be out of date as soon as a small field description is changed. And if we missed something, a reviewer would blame us for making poor documentation.

 

Due to those crazy and stupid templates, we end up having small source codes for simple processes with huge documentations. Documentations nobody ever care to read.

 

 

 

Coding ABAP in a Word Document

 

This one is classical. Some ABAP developers just don't care at all about code documentation. They don't write comments in the source code, and whenever they get a change they open a new word document, copy-paste the abap code from se80, name the file "SD.001 - My Program - TD" or something and consider they development is finished.

 

CTRL+C CTRL+V from ABAP to a Word Document.... JUST DON'T. It would be better if those guys doesn't even started making the "filler" file. The funny fact about it is that some reviewers consider this outrageous thing as something completely "legal".

 

It's all about the package: The project want to have the TD file; it doesn't matter if it's a piece of garbage. And I've seen more than one "CMMI level 5" software factories doing that. Way to go buddies...


 

 

Creating a DUOBM (Document Understandable Only By Me)

 

Ok, so the guy doesn't have to follow a stupid template, nor intend to make it a carbon copy of se80. But guess what: he also doesn't care about explaining to another developer how his code works.

 

The whole point about having a software documentation is so other developers can understand the software. If one fail in writing a good documentation he's also failing in delivering useful information about his creation. That development is a great candidate to become an "old and ugly Z monster nobody knows what is doing".

 

One of my favorite SAP technical documents of all time is the explanation of the good old iXML library. Take a look at this: http://help.sap.com/saphelp_nwpi71/helpdata/de/86/8280c012d511d5991b00508b6b8b11/content.htm . It's fun to read, it's well organized, and the writer knows he's explaining things to another developer. That's a major issue with software documentation in SAP projects: almost nobody cares about who's coming next. Let's just deliver everything until Go Live, make a Happy Hour and move to new projects. G-R-E-A-T.

 

 

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

 

See? These are things me and my ABAP friends faced tons of times in Brazilian and International projects. Many gigabytes of word documents created because the project methodology said they must exist before software can pass through the homologation process. A sad truth.

 

Hopefully now you're not thinking I'm nuts by saying we should get rid of those documents. But don't get me wrong: I do like the idea of having a document explaining the software. Maybe not in the form of an word file: it can be an document created inside the SAP system, some entry in a CMS or even a small HTML file created with ASCIIDOC. But I strongly think we should be making things differently.

 

Therefore, I know a couple of things that can help making software documentation a relevant piece of information. Turns out they are very simple things people tend to ignore.

 

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

 

 

What would you like to read in a Technical Documentation?

 

Get in front of a mirror and ask yourself: What you like to read in a TD? A lot of technical junk you could easily find by going to the relevant transactions, or something that helps you understanding the technical approach of that code?

 

Why you choose to add parallelism? Why did you have to use that complex recursive logic? A call transaction over a BAPI for VA02... why did you choose to do that? How your objects communicate with each other? Why that small functional process described in the functional specification turned out to be 5000 lines of code?

 

Answer questions like these on your TDs. Your ABAP colleagues will thank you for that.

 

 

 

Don't get too much "techy"

 

This may sound odd at first: if we're doing the Technical Documentation, why can't we go deep down into technical stuff? Because you should explain these things using commentaries. I've seen a lot of TDs trying to explain small little pieces of coding techniques inside the documentation, but I strongly believe these are things that should have been added as commentaries in the source code.

 

Example: "no read binary search on table X - can't sort it with this key because of <something>". That has much more value as a commentary instead of going inside the TD. People forget that commentaries are also a way of documenting what you're doing. Most times when we're trying to correct a small issue, we go directly to the debug screen, trying to solve the issue. Small and relevant comments can be extremely helpful in those situations.

 

Oh, and I'm yet to see a developer asking for the TD when his boss starts screaming on him about a bug in an old production code...

 

 

 

If you can't drop the template... what about a new one?

 

Technical Documentation templates were probably created by someone that though those were the relevant information they would like to see in the future. But sometimes those people are not experienced developers, so how can they know what really has to be in there?

 

If you're in a place where you can't stop using a "closed" template, make suggestions to remove the useless stuff and add some guidelines to help others adding value to that document. I bet you managers and leaders will change if it's for the best.

 

I had the experience of completing changing a project template once, and everybody loved. Even a functional consultant friend of mine was always saying about how he could read my TDs to help him understanding the programs from a technical perspective.  "A functional consultant reading a TD"? Believe, it's true!

 

 

 

Starting reading some TDs!

 

I didn't realize these tips out of nowhere. When I was a very young ABAP n00b, I believed in unicorns, fairies, dragons and also in TDs. Yes, everytime I had a problem I tried to read the TD first, to see if it could give me a clue about the code. However, most times they failed miserable.

 

As time passed by I started debugging the code without reading anything at all. People wasted time doing TDs, but I didn't want to waste my time reading them.

 

It happens that old habits die hard, and even today I do like to take a sneak peak inside TDs. And yes, they've been the same in ABAP projects since 2006. I found cool documentations throughout these years, and they were the ones that opened up my eyes and made me change the way I wrote documentations.

 

Start reading some, and change too.

 

 

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

 

 

I think that's everything I have to say about code documentation for now. I wrote about them in the past, but I thought this was a good time to raise the topic once more (this blog motivated me).

 

Please, share your experiences with ugly/cool documentations on the commentaries. Let's debate and change this old "non-documentation" process.

 

Thanks very much for reading!

 

Best Regards,

Mauricio Cruz.

push buttons created in ALV are not functioning. help me out

$
0
0

REPORT  ZPUSHBUTTON.

TYPES : BEGIN OF TY_VBAK,

         VBELN TYPE VBELN,
         ERDAT TYPE ERDAT,

         ERNAM TYPE ERNAM,

END OF TY_VBAK.

 

DATA : IT_VBAK TYPE STANDARD TABLE OF TY_VBAK,

WA_VBAK TYPE TY_VBAK.

 

SELECTION-SCREEN BEGIN OF SCREEN 200.

SELECT-OPTIONS : S_VBELN FOR WA_VBAK-VBELN.



SELECTION-
SCREENBEGINOFBLOCK B1 WITHFRAMETITLETEXT-001.

SELECTION-
SCREENSKIP3.
SELECTION-
SCREEN PUSHBUTTON /15(10) TEXT-002 USER-COMMAND CL1.
SELECTION-
SCREEN PUSHBUTTON 45(10) TEXT-003 USER-COMMAND CL2.


SELECTION-
SCREENENDOFBLOCK B1.

 

IF SY-UCOMM = 'CL1'.

CALL SELECTION-SCREEN 200 STARTING 10 10 ENDING AT 100 10.

ENDIF.



How to export multiple spools in SP01/SM37 into HTML or PDF?

$
0
0

Hi guys,

 

I am a total newbie in SAP but I have been tasked by my supervisor to download/export multiple spools that I have specified in SP01 or SM37. Basically there are 7 usernames to be downloaded for month end processing. at the moment I am download it via SM37 and clicking one by one and saving locally. I was thinking if there is an easier way to do this, since there are about a couple of hundreds of spool to be downloaded and some of the spools are more than 3000+++ pages. Can someone help me with this ?

 

I am very sorry for this is my first post and a total noob.

 

Regards

Archproject

IL02 - BAPI to Update Classifications Value

$
0
0

Dear Experts,

 

 

I’m looking for a BAPI for Functional Location Change (T-Code is IL02).

I found BAPI ‘BAPI_FUNCLOC_CHANGE’. This BAPI is working fine.

 

But My Requirement is to update the Classification details for the Functional Location.

Please give suggestion how to update this.

 

IL02- Initial Screen.png

 

IL02- Screen 1.png

IL02- Screen 2.png

 

Thanks in Advance.

 

Regards,

Kumar

Viewing all 8332 articles
Browse latest View live


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