New Line Generation in ABAP

Hi,
I need to generate a new line in ABAP.Is there a command which generates a new line.
For Example:
Input: lv_string1 = 'ABC', lv_string2 = 'XYZ'
Concatenate : lv_string1 <newline> lv_string2  INTO lv_string.
Output:
lv_string should look like this:
'ABC
XYZ'
Regards,
Roshith

Hi Roshith,
1. Ya, u can generate a new line character
2. BUT, its effect won't be there
   while displaying using write
3. try this code (just copy paste)
report abc.
data : v(100) type c.
data : s(2) type c.
class CL_ABAP_CHAR_UTILITIES definition load.
v = 'amit'.
concatenate 'amit'
CL_ABAP_CHAR_UTILITIES=>newline
'mittal ' into v.
write :/ v.
regards
amit m.

Similar Messages

  • New line character in ABAP

    Hi,
    How do ABAP stores new-line character internally?
    Thanks and Regards,
    Sharadha

    Hi Sharadha,
    You can use :
    data :str1(100) type c value 'aabbddcd/ddhdhd',
          count type i.
    vlen = strlen(str1).
    do vlen times.
    if str1(count)= CL_ABAP_CHAR_UTILITIES=>NEWLINE
    then <NewLine Character processing>
    else.
    count = count + 1.
    endif.
    enddo.
    Cheers,
    Vikram
    Pls reward for helpful replies!!

  • Unwanted field validation when adding new line to ALV (ABAP OO)

    Hi,
    We are using OO Controls to create an editable ALV grid, whose structure contains debit/credit indicator.
    When we click on the standard add new line button, a new line is added but an error message appears telling the user to enter a valid credit/ debit indicator (of course it is blank in the new line).
    This is annoying for users - is there any way to suppress this when....but just when a new line is being created?
    Thanks,
    Tristan

    Debug and find out what is the sy-ucomm when you add a new line in the ALV. And then In the validation of "enter a valid credit/ debit indicator " put a IF condition to check the if the SY-ucomm is not for inseting new line.
    Hope this helps.
    Fran

  • How to insert a new line item in VA01/VA02 by using ABAP code?

    Hi Gurus
    i have a very tough requirement. the customer wants to insert a free goods after an item has been populated in VA01/VA02 automatically according to some certain rules. the input material may be a main material of a sales BOM.
    for example. let's suppose there is a material A who has two sub-material B and C which is maintained in a sales BOM via CS01/CS02. when the material A has been input in the line item in VA01/VA02, its quantity input and after the ENTER key has been clicked, another material D may be displayed in a new line as a gift if the condition met.  the condition relates to customer/material/quanity and these information are stored in a Z-table.
    on the other hand, if the material A is only a single material(not a BOM), the gift(material D) will also be filled automatically if the condition met.
    i have already enhance the FM cs_bom_explosion to filfill the requirment for BOM materials. whereas it is very hard to find the enhanment point for the single material.
    so my question is where is the correct place for me to insert the ABAP code, which decides whether the gift should be given or not and furthermore inserts the new line item into XVBAP. i tried to use MV45AFZZ, whereas the data is always inconsistant if a new line has been inserted. it is very strange that there is no temperary internal table storing line item data input in the table controal of VA01/VA02. system reads the line item data , line by line, via a system kernal function call.
    any hints are welcome. thanks

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

  • Regarding problem with new line feed for DME file generation

    Hello Experts,
    I m facing a problem in the DME file generation.
    we want each record in the DME file should be in new line. for that we have add the new line feed character in the each row end. So in the SAP output it looks ok, But if we download that file the carriage return field is coming in the end of every row.
    can any one tell how to solve this issue.
    Please refer the below line code which i m using for new line
    DATA: GM_newline TYPE c VALUE cl_abap_char_utilities=>CR_LF
    You reply is valuable..
    Thanks,
    Suresh

    DATA: GM_newline TYPE c VALUE cl_abap_char_utilities=>newline.

  • New line feed in SAP ABAP

    Hello All,
    I am facing problems to handle long text in my RFC. I have created a field with character type of length 1000. Client sending data into it. ultimately i need to pass that text into Inspection text of material master creation. I devided it as 72 character lengh and paasing it into material master. but when passes text as continueous line its working fine. when data sent as different lines, it is calculating 72 characters and deviding the text.  client passing data as follows..
    1.Material master creation
    2.Created by Joy
    3. created on 29.05.2009
    4.To be maintained in all plants of US
    but when 72 characters are over it is starting it from next line as follows..
    1.Material master creation
    2.Created by Joy
    3. created o                   ( if 72 characters over here)
    n 29.05.2009
    4.To be maintained in all plants of US
    is there any way to identify the next line feed in ABAP and other logic to handle this situvation.
    If u haven't get my problem pls ask me i will explain it further.
            Kumar.

    Few questions which might help to understand the issue.
    1. Is client's data is coming in more than 72 chars per each line? Then you can request client to send the data with max. 72 chars per line. Else dividing the string into 72 chars will loose the readability of text since logic can not be built to divide the text.
    Start reading the text string starting from left for maximum 72 chars . If 72th character is non space then go backwards i.e. read 71, 70, 69... till last character should be a SPACE.
    Eg. string is
    'xxxxxxxxxxx...........This material is created for plant xyz. date of creation is 03.02.2009'.
    x = string72(1) should be a SPACE else take x = string71(1)  and likewise.

  • Continue ABAP onto new line

    I am trying to write the following in an UR
    RESULT = RESULT + ( COMM_STRUCTURE-RECTOTSTCK +
    COMM_STRUCTURE-ISSTOTSTCK ).
    I place the logic on one line and check syntax and all is ok.  When I view in the UR I have a red traffic signal.  When I go back to the logic some of the end of the code on the line has been discarded.  How can I place the logic over two lines in the ABAP UR routine?
    Thanks

    Hi Niten.
    Try with:
    CONCATENATE COMM_STRUCTURE-<i>NAMEOFRESULTFIELDINCOMMSTR</i> COMM_STRUCTURE-RECTOTSTCK COMM_STRUCTURE-ISSTOTSTCK INTO RESULT
    Hope it helps.
    BR
    Stefan

  • How to make a new line item appear in a sales order in VA01 transaction?

    Dear All,
    I am trying to create a SO with single line item with quantity 100.
    Upon hitting the 'Enter' key, if the available quantity is less than the requested quantity (say 20), it takes me to an availabilty control screen which has a push-button 'One-time delivery' on the application tool bar.
    Upon clicking on this button, it takes me back to the main screen of VA01 where I currently see only one line item with quantity 100 and confirmed quantity 20.
    My requirement here is to make two line items appear, one with quantity 20 and the other with quantity 80, once I navigate back to the main screen of VA01 after clicking on the push-button 'One-time delivery'.
    Please provide me your valuable inputs. Any kind of help is highly appreciated.
    Useful answers never go unrewarded.
    Regards,
    Sreekanth Reddy B.

    Hi Sreekanth ,
    creating line items based on the confirmation qty can be done thru config, not thru ABAP,standard SAP will gives you options to create a new line item for unconfirmed qtys.
    check with ur functional consultant or try to post in SD /APO forums.
    regards
    Prabhu

  • Block creation of new line item in SO

    Hi,
    Scenario:
    In the sales order, the order quantity of line item 10 is 10pcs, only 5pcs is shipped. I want to allow the remaining 5pcs to be able to ship at some other time. However, no modification is allowed in the order quantity of this line item 10. Also, no addition of new line item in this sales order.
    Question:
    How to block creation/addition of new line item or block modification in the order quantity of the existing line item, but allow the existing line item to be shipped in a sales order?
    Thanks.

    Hi Wooi,
                 You can control through User authorisation, you maintain the authorisation for VA02 for the specific User with the help of BASIS people.
    If you donot want maintain the authorisation you need to activate the User Exit for the with the help of ABAPer.
    You can use these User exits.
    The program is MV45AFZZ
    USEREXIT_READ_DOCUMENT
    USEREXIT_SAVE_DOCUMENT
    USEREXIT_SAVE_DOCUMENT_PREPARE
    I hope it will help you
    Regards,
    Murali.

  • New line item insertion in delivery via EDI - PI

    hi,
    the requirement is to insert a new line item in the delivery.
    This new line item inserted should be done via an IDOC, which while entering the SAP will insert a new line item in the delivery.
    The question if this line item insertion should be done through the inbound FM in SAP or via XI/PI.
    How will this be done in PI??
    Thanks a lot

    Hai,
    How you delivery creating or updation working in ECC??
    like if you are using PI interface create/update delivery in ECC ,then you cae use PI only to insert new line item for material id.
    else if you want do manually you can create in VA02/VA42 TRASACTIONs or using function module also we can do that.
    option is yours.
    if you dont have much idea then better to talk with ABAP/Functional guys they will easily do this without PI.
    Regards,
    Raj

  • Pricing Date on New Line Item Added to Order

    We have a requirement, for example, if we create an order for 07/19/2010, the pricing date comes in as 07/19/2010 which is correct.  The customer calls back and wants to add a line item or 2, to the order on 07/22/2010.  The new line items are priced as of the original pricing date 07/19/2010.  How do we automatically update the new line items with today's pricing date instead of the old date.  Is there an automated way to do this thru configuration.  Or do we need to use user exits:
    MV45AFZZ - USEREXIT_PRICING_PREPARE_TKOMK
    MV45AFZZ - USEREXIT_PRICING_PREPARE_TKOMP
    Thanks,
    Mark

    Hi,
    There is no automatic way to populate the pricing date for item when item is added at later point of time. In this case, the pricing date at header is copied to the item.  This cannot be achived by configuration.
    As you have mentioned, you have to use the user exits relevant for pricing. The user exits you have mentioned are not correct for this purpose. The purpose of these user exits are different. You need to find the correct one with the help of an ABAPer.

  • Content Conversion not creating a new line....

    I have areceiver FCC configured in my scenario but the problem is that output file is producing content which comes over one line...
    As in there is no new line for each substructure.
    This is a new problem as last month when we tested the scenario worked perfectly... now though it seems as though the receiver adapter is doing some sort of URL encoding as instead of a new line I get a symbol where the new line should begin...

    Hi Mendez,
    Are using this in your FCC:
    Item.<b>endSeparator ---> 'nl'</b>
    if not use it your problem will be solved. Alos have a look into this:
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns - FCC
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file - FCC
    /people/harrison.holland5/blog/2006/12/20/xi-configuration-for-mdm-integration--sample-scenario - FCC - MDM
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp - FCC
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy - FCC
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter - EOIO - File
    Regards,
    Sarvesh
    ***Reward points if found helpfull.

  • Add new line in ALV report on click of button...

    Dear All,
    How to add a new line for input in ALV report at runtime, on click of a button.
    Waiting for early and favorable reply.
    Regards,
    Dharmesh Vyas

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

  • Add new line in ALV report and Refresh button

    How to add a new line in a ALV report?
    How to add a refresh button in a report?

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

  • Replacing New Line character in a hexadecimal string in ECC5.0

    Hi,
    I am trying to create an XML document using ABAP.
    I have created one DOM and later used the DOM to get the XML content into an internal table in form of Hexadecimal String. In that internal table(which contains XML in form of hexadecimal content), I want to search for the new line character and replace it by Space.
    I have used class CL_XML_DOCUMENT to create such document.
    Now, the keyword 'SEARCH' which searches the New Line character, works on the hexadecimal content of the internal table in 46C and I get an XML document. I get the position of the New Line in SY-FDPOS and can do whatever I want. But SEARCH on hexadecimal content is not permitted in ECC 5.0. I get a syntax error when I try to do so. Tried many options but could not succed.
    Would apreciate if anyone can help in finding and replacing characters like new line, tab etc in a hexadecimal string.
    Thanks.
    Can anyone

    Hi!
    When you say hexadecimal string, you mean variable - otherwise string (= character) operations would work?
    Then you have to go for hex handling -> do it yourself. Make something like
    data: lf type x value '0A',
          sp type x value '20',
          i type i.
    I = 0.
    while sy-subrc = 0.
      if hex_string+i(1) = lf.
        hex_string+i(1) = sp.
      endif.
      add 1 to i.
    endwhile.
    Regards,
    Christian

Maybe you are looking for

  • Come on Apple - this is not enough!

    Come on Apple - this account mess has to be streamlined! Really! My setup: 3 different Macs, 2 iPhones, one iTunes Library, my wife, me. We both use all 3 Macs and have our own accounts on each machine. We have both our own MobileMe account. (Wife ha

  • ITunes Match on Mac but not Macbook Pro?

    Hi, I have paid and installed 'itunes match' on my main Mac which has my library, it has synced to my ipad, iphone 4, Apple TV and ipod touch but it isnt working to my macbook pro?! It says only one library can be used but I want my music (not all th

  • Need help restoring a C: (boot) drive on a client computer

    What is the best way to restore the c: drive on a client computer?  The SSD died so I have to start with a new drive.  Can I plug the new drive into another client that is working and restore the drive from there?  Or, do I need to install the OS on

  • In outlook 13, How can I get my new mail to populate my existing "account" or "Profile" instead of two separate ones

    I set up outlook, using mainly wizards. I have received some mail from my provider account. trying to get data from my old pc, I accidently set up another account, it became default. I finally got it deleted I now have my first profile with email I r

  • Dataguard in 10g db

    Hi, I am using oracle 10g in rhel 5 server trying to create a standby database by taking backup in primary database and moving the backup to secondary db server and issuing the duplicate command.But my primary db has the mount point */data/u01* and m