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

selecting range and multiple selection options

$
0
0

Hi all

 

i have a requirement where user can specify range and selection options, accordingly i need to fetch the data,

if only multiple selection is specified i can loop to s_input-low and get the values.....but if range is also specified

at the same time how to i write a query to fetch the values.

 

 

Thanks

Bhargava


ABAP : Add Yes / No popup before invoice print

$
0
0

Dear Abap Experts,

 

We want to give the user a popup message (Yes / No) before printing the billing document (Invoice , The Tcode is VF01).

I mean user must select Yes for print out and no for no print out by the printer.

How can we do this.? Should we use user-exit or by some ABAP code.? The program name in the NACE is RLB_INVOICE.

I have tried all the userexits for the Tcode VF01 but no success. I have checked many threads on SCN but no solution found.

I will be very thankfull to you if any one can help. Image is also attached for more clarification.

 

Regards,

Aneel Munawar

CSAP_BOM_ITEM_MAINTAIN clearing Custom Fields Issue For Numeric Data types

$
0
0


I have added 2 custom fields in  STPO (1 character and 1 Numeric).

 

 

To reset the values in the table through program , I use the Function Module  CSAP_BOM_ITEM_MAINTAIN.

I use the reset sign "!"  for the character field and clears the value without any issue.

 

However for the Numeric fields , I cannot pass the  above sign  and passing "0' also doesn't over write the values.

 

Can anyone provide suggestion /ideas?

 

Thanks

Ram

Forwarding Agent issue while doing PGI.

$
0
0

Hi,

 

I got a requirement like need to update forwarding agent from Delivery creation. I am getting the error message like  "Document is incomplete: You cannot post goods movement". however this issue is getting if Delivery has multiple items. If single Item in Delivery then Forwarding agent is updating and PGI is happening.

Can anybody please help me?

 

Thanks in advance.

SAP ABAP : Repeat Output on ME22N via ABAP code

$
0
0

Hi,

 

Im creating a program that will repeat output if we have not received OrderResponse in X amount of time.

Is there a function Module that allows me to repeat output by providing the Purchase Order number?

 

Thank you,

 

Jannus Botha

An Alphabetic Counter

$
0
0

Introduction

 

An alphabetic counter is a counter that increments from A to B to C etc. through all letters of the alphabet. After Z the counter increases its length by one and increments from AA to AB to AC, etc. By applying this pattern recursively, an alphabetic counter may have an infinite number of values just like a numeric counter. An example with which you may be familiar is Microsoft Excel which uses an alphabetic counter to uniquely name columns.

 

Incrementing the Counter

 

An odometer is a useful model for incrementing an alphabetic counter. From right to left, each position increments from A to Z just as each position of an odometer increments from 0 to 9 (though each alphabetic position actually has blank as its starting value). When the final value is reached (Z or 9) the position rolls back to its starting value (A or 0) and the left-adjacent position is incremented. This algorithm can be applied recursively at each position along the alphabetic string.

 

Example 1

N...321
A
increments to →
N...321
B

Example 2

N...321
Z
increments to →
N...321
AA

Example 3

N...321
AZ
increments to →
N...321
BA

 

Translating this Algorithm to ABAP

The routine to implement this algorithm is recursive. It increments an alphabetic string at a specific position then, if that position has reached final character Z, increments the left-adjacent position by way of a recursive call to itself. In this demonstration, the algorithm is implemented as a method of a class, but it may also be implemented as a function module, form subroutine or other routine.


Create method increment_alpha with the following signature.


Parameter Declaration TypeParameter NameParameter Typing
Importingvalue( position )type i
Changingalphatype csequence
Exceptionnon_alpha

 

method increment_alpha.    data offset type i.    data character_tab type standard table of char1.    field-symbols <char> type char1.
*  Split changing parameter alpha into a table of single characters to facilitate substring handling    call function 'SWA_STRING_TO_TABLE'        exporting            character_string = alpha            line_size            = 1        importing            character_table  = character_tab        exceptions            others                = 0.    if position is initial.        add 1 to position.    endif.    read table character_tab assigning <char> index position.    check <char> is assigned.
*  An initial character is incremented to 'A'    if <char> is initial.        <char> = sy-abcde(1). " A
*      Reconstitute changing parameter alpha from the character table        call function 'SWA_STRING_FROM_TABLE'            exporting                character_table  = character_tab            importing                character_string = alpha            exceptions                others                = 0.        exit. " we're done    elseif <char> cn sy-abcde.        raise non_alpha.    endif. " <char>
*  Increment the alphabetic counter string    case <char>.        when sy-abcde+25(1). " Z
*      Roll Z back to A at the current position        <char> = sy-abcde(1). " A
*      Reconstitute changing parameter alpha from the character table        call function 'SWA_STRING_FROM_TABLE'            exporting                character_table  = character_tab            importing                character_string = alpha            exceptions                others                = 0.
*      Increment the left-adjacent position by recursively calling this method        increment_alpha(            exporting                position = ( position - 1 )            changing                alpha    = alpha        ).      when others. " A-Y
*        Increment the current alphabetic character          find <char> in sy-abcde ignoring case match offset offset.          add 1 to offset.          <char> = sy-abcde+offset(1).
*        Reconstitute changing parameter alpha from the character table          call function 'SWA_STRING_FROM_TABLE'              exporting                  character_table  = character_tab              importing                  character_string = alpha              exceptions                  others                = 0.    endcase. " <char>
endmethod.


The initial call to increment_alpha method passes in the whole alphabetic counter string using its complete length as position. The method then recursively increments the alphabetic counter string one character at a time along the length of the string.


data alpha_counter type string value 'ABC'. " for example
* Increment the alpha counter and assign equipment name. We extend the
* length of the alpha string by 1 place to accommodate a potential additional
* character, e.g., Z > AA.
shift alpha_counter right.
increment_alpha(    exporting        position  = numofchar( alpha_counter )    changing        alpha    = alpha_counter
).


Sorting Counter Values


To correctly sort alphabetic counter values like A, Z, AB, BA, we cannot rely on a simple character sort because AA would come before Z which is not true in the odometer model. An algorithm which calculates the sum of each alphabetic character's ASCII numeric value multiplied by its odometer position provides a reliable sort value for alphabetic counter values.

 

Example 1

N...321
A
to ASCII →
N...321
65
result →
65 x 1 = 65

Example 2

N...321
Z
to ASCII →
N...321
90
result →
90 x 1 = 90

Example 3

N...321
AB
to ASCII →
N...321
6566
result →
65 x 2 + 66 x 1 = 196

Example 4

N...321
BA
to ASCII →
N...321
6665
result →
66 x 2 + 65 x 1 = 197

 

Translating this Algorithm to ABAP


data alpha_counter type string value 'ABC'. " for example
data offset type i.
data character_at_this_position type char1.
data sort_value type i.
do strlen( alpha_counter ) times.    offset = strlen( alpha_counter ) - sy-index.    character_at_this_position = alpha_counter+offset(1).    sort_value = sort_value + ( cl_abap_conv_out_ce=>uccpi( character_at_this_position ) * sy-index ).
enddo.


When applied to a table of alphabetic counter values, each record's sort value may be used to correctly sort the table according to the odometer model.

batch input me21n

$
0
0

My problem is: I have record me21n in shdb, I'm inserting data from itab into the 'item grid' at the bottom of me21n. The problem is, I can insert only 10 records, then I get an error: "Field RM11P-KOSTL(11) is not existing on screen SAPLMEGUI 0014". Like I said... only 10 records Is there any way to 'scroll' down this grid to another 10 records in ABAP code using those 'bdc_field' commands. Pleas help!

Control PO output triggering based on changes made

$
0
0

Hi Experts,

 

I have a requirement to control PO output type triggering when changes are made in several fields of PO. In current scenario, output is getting triggered everytime I made any changes to PO(this is fine and as per requirement).

 

But Now I want to restrict this output type triggering when the changes made to several field only (i.e Delivery time, date, header texts, PO quantity etc).

 

I have created a new requirement routine 9XX, and assigned to respective output type. Here by setting sy-subrc I can control output triggering of PO.

 

I thought of using FM 'ME_READ_CHANGES_EINKBELEG ' or 'CHANGEDOCUMENT_READ' in requirement routine to track the changes made to PO, but challenge here is PO changes are NOT yet stored at databases level. Changes(update) is in process and in between output type(requirement routine) is getting triggered.

 

So can you please help me in suggesting is there any BADI/Exit  I can use where I can find scope of changed PO data, where I can write my logic and pass a flag to requirement routine to control output. ?? or is there any other way to archive this requirement.

 

 

Thanks in advance

Sagar


Transport table contents 'all entries' not working?

$
0
0

Cannot transport table contents. On SE16 etc., Table Entry-> Transport Entries in the menu is greyed out so this is not an option.

In the request in SE10 I enter R3TR, TABU, ZMYTABLE in the three columns and then double click.  

I select the radiobutton for 'Entire table' and click enter.

But then there is no way of saving these entries?

I get the screen below, and I select all with the 'Select all' button, but how do i get these entries in the transport as there is nothing further to click on?

Capture.PNG

 

 


Adobe forms PAGES

$
0
0

Hi experts.

 

Im beginer in adobe forms

 

i need  print seguence.

 

1- header page

2-item pages

 

In smartforms we call next page but how can we in adobe forms.

Table to Store Archived Document for FB03

$
0
0

Dear Experts,

 

In FB03 we are creating some documents. Can you please suggest table where this document stored, I mean I want to know whether document is created or not.

 

I Tried the table SRGBTBREL, but it is not showing Archived documents.

 

FB03 Dcoument.JPG

Table SRGBTBREL.JPG

 

In the above screen shot there are 3 attachments,But  SRGBTBREL is showing 2 entries only, that mean it is not showing archived documents.

 

 

 

Please suggest the table or logic where the archived documents stored.

 

Regards,

Kumar

Open Acrobat Reader with PDF table content

$
0
0

Hi there,

 

i have an function module which returns a PDF as "binary content", see bolded export parameter..

 

FUNCTION ptrm_web_form_pdf_get.

*"----------------------------------------------------------------------

*"*"Lokale Schnittstelle:

*"  IMPORTING

*"     VALUE(I_EMPLOYEENUMBER) LIKE  BAPIEMPL-PERNR

*"     VALUE(I_TRIPNUMBER) LIKE  BAPITRIP-TRIPNO

*"     VALUE(I_PERIODNUMBER) LIKE  BAPITRVXXX-PERIOD DEFAULT '000'

*"     VALUE(IV_VERSION_TRIP_COMPONENT) TYPE  PTRV_TRIP_COMPONENT

*"       OPTIONAL

*"     VALUE(IV_VERSION_NUMBER) TYPE  PTRV_VERSION_NUMBER OPTIONAL

*"     VALUE(I_TRIP_COMPONENT) TYPE  PLAN_REQUEST DEFAULT SPACE

*"     VALUE(I_TRIP_DATA_SOURCE) TYPE  PTRV_WEB_SOURCE DEFAULT 'DB'

*"     VALUE(I_DISPLAY_FORM) TYPE  XFELD DEFAULT SPACE

*"     VALUE(I_LANGUAGE) LIKE  BAPITRVXXX-LANGU DEFAULT SY-LANGU

*"  EXPORTING

*"     VALUE(E_PDF_FORM) TYPE  FPCONTENT

*"  TABLES

*"      ET_RETURN TYPE  BAPIRETTAB

*"----------------------------------------------------------------------

 

Now to my question: is there a function module or method in some class where i can open acrobat reader and display the PDF inside acrobat reader ? (Like opening an PDF in the GOS (generic object services))

 

br Martin

Method to check any excel file is open or not on presentation server or pc

$
0
0

I am downloading the data of ALV to Excel using OLE methods, but before downloading how can i check that any excel file is already open on PC or not?

We have options to check whether the excel file is already open or not with the known name but how we can check for the opened file without knowing its name or path?

how to locate the warning message in SAP

$
0
0

Hi experts,

 

i am not very deep in ABAP programming and however facing now a problem.

I got a warning message in SAP sales order ( after variant configuration is done), the warning message seems to be developed by some former colleague in userexits or z-programms ( at least not sap standard). I can find out the message class and the number of the message. But i only can use /h so that the debugging screen comes, but it seems like thousands lines of codings to read before the message is called.

 

Does any one know how to debug effeciently to find the location where this message is called ? because the coding/ logic  before or after the message is important for me .

 

 

Thanks!

 

Regards

Recke

performance for huge table

$
0
0

Hi  Friends

 

I need to fill data from excel file and implement below logic for all the fields  and at last finally need to update custom table .

 

    A  table has  more then 35 fields  then in these fields there is one field  ' STATUS ',

 

first after picking data from file  need  to check all 35 fields one by one from starting 2nd field of table ,, if any field has value then its mean  1  ,if not then 0   like that  need to read table from  2nd field of table and concatenate these values and pass to  field  STATUS .

 

Eg   if  table  test had  5 fields

1  A =  'ttt' .

2  B =     ,

3  C =  '33'

4  D =  '343',

5  Status .      In this case  status values should be  '1011'.

 

now my query if  what could be the most optimized , performance side best method to write this logic as there will be multiple records and  35 fields need to read to update this logic .


Default movement type in MIGO_TR

$
0
0

Hi ,

 

 

I have tried to give default movement type in MIGO_TR . I used screen variant for that . How can I give default movement type using GUiXT Script .

 

Default [GODEFAULT_TV-BWART] "305" . This is the code  I have used .Kindly suggest

 

 

 

Regards,

 

Subeesh Kannottil

Error in BBP_PD_PO_CREATE

$
0
0

Hello everyone.


I am getting message error  in BBP_PD_PO_CREATE.

 

Message error: Select localization which was assigned to the selected plant, msgno - 358.

 

Please, I would be very thankful if someone help me with the parameters to this function or any suggestions.

 

 

Thank you all.

BAPI to upload facts @ rate category level

$
0
0

Dear ABAPers,

is there any function module to upload facts value at rate category level in ISU..

I got BBAPI to upload Installation facts in ISU..

Please help me..


Batch Input messages

$
0
0

Hi Expert!

 

I have a batch input programmed. If I execute the batch input in this way:

 

CALL TRANSACTION 'TM02' USING gt_bdcdata MODE 'A' MESSAGES INTO it_messages


I can see al dynpros and everything is ok.


But when I execute it in this other way (I need this way):


CALL TRANSACTION 'TM02' USING gt_bdcdata MODE 'N' MESSAGES INTO it_messages.


Nothing is made. I think that is because during the execution appears some messages (Type S and I any error) and the execution is stopped.


Also, when this happens I go to SM35 but my batch input is empty.


Can you please help me with these two issues?


Best Regards and thank you very much!



Smartforms not generating function module name

$
0
0

hi.

I need a small information.

Normally if we create any smartforms it will generte one function module up to this i know.

I want to do some changes in the smart forms.

so, i dont want to directly worked on original smart forms

so, i just copy the smart froms by using copy in smartforms.

so, Now i had done some changes .

Everythign is fine.

but if i execute it.

it is generating function module name.

but if i see the under environment at application tool bar it is saying

no function module generated yet.

 

while executing it is generating one number..

but it is not taking permanenlty.

if i see under the environment there is no function module name.

bcz

in se38 i need assign it..

means calling.

if i run se38 program sy-subrc eq 1 it is showing...

which menas not found

Viewing all 8332 articles
Browse latest View live


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