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

Text literal and String literal

$
0
0

What is the difference between text literal and String literal ?


Export to Excel-Date missing

$
0
0

Hi All,

 

While exporting the data from ALV output.

Code level nothing is being changed.

 

Previosly while exporting to excel, in the generated excel data and the  date used to come on the left top.

Now i am getting the data alone, missing the date.

 

I searched in SCN but couldnot get any solution.

PFA old and new screen shots.

I have highlighted the the date in Yellow mark.

Our system get upgraded recently. Is this related.

Please suggest.

 

 

Regards,

Munu

BDC Program for tcode fb01

table control with wizard scrolling incon

$
0
0

hi all,

 

i have  developed module pool program with table control with wizard.

 

in that while creating itself i checked , the scroll check box.

but when i am  executing the program , if i click the next page or any of four icon its not working , instead of that it is saving the record.

 

for that icon , system it self will create coding right? or we have to right any code for enable that?

 

i checked tha sap scn thread also and tried but its not working.

 

help me to slove this issue.

 

regards,

s.kavitha

Enable Edit button in FPM_OIF_COMPONENT

$
0
0

Hi all,

 

I don't know if this is the right place to post this

 

I have the requirement to enable button edit in the next screen:

 

1.png

This is the technical help:

 

2.jpg

 

They want this:

 

3.jpg

Is the same component, but I don't know where could I change that. What should I do?

 

Thanks in advance, best regards!

Getting the Table from CL_GUI_ALV_GRID

$
0
0

I have an interesting problem.

 

I have the object io_alv_grid of type CL_GUI_ALV_GRID in this method of a BADI that I'm implementing, but I do not have the actual data of the internal table.

 

Is there any way to extract the data of the alv from that object?

 

The BADI is WORKORDER_INFOSYSTEM, method AT_OUTPUT_SCREEN_LAY and I can get the data from an earlier method by EXPORT/IMPORT, which works fine. Except that if the user has any layout or sorting set (which they do) my internal table is incorrect. I need it in it's current state so that I can get selected rows and do actions based on a button pressed.

 

 

Thank you for any help.

Google Chrome Require as Browser

$
0
0

Hi,

 

I have developed a simple program, to open browser inside SAP screen,

 

Class Used: CL_GUI_HTML_VIEWER.

Method: SHOW_URL.

 

In Method, passing any URL like www.google.com.

 

And able to display the google.com inside the SAP screen.

 

But requirement is, I want to use Google Chrome Browser, it's opening IE.

 

Is there any way to change Browser Setting in SAP, I want Google Chrome as Default for SAP.

 

Regards.

Praveer

How to show the attached document in email in inline mode

$
0
0

Hi, ABAP Community.

 

In our project there is a need to send a document to end-user e-mail account, in this specific case it is Microsoft Outlook. The sending is working, but I have a problem with the way it arrives the user mailbox. The HTM-file arrives as an attachment while I would like to see it in inline mode — straight in the message body.

 

Below, I post some code fragment to let you understand what exactly I'm doing. Suppose, my function has already the document in binary format (SOLIX_TAB), now in order to send the document the class CL_BCS is used and I have to follow the next steps:

 

  1. Create the document with CL_DOCUMENT_BCS:
    document = cl_document_bcs=>create_document(                          i_type = 'HTM'                          i_text = im_text                          i_length = txt_len                          i_subject = im_subject ).
  2. Add the attachment:
    CALL METHOD document->add_attachment               EXPORTING                          i_attachment_type = 'DOC'                          i_attachment_subject = im_document_name                          i_att_content_hex = im_doc_attachment.
  3. Add the document to the send request:
    DATA: send_request TYPE REF TO cl_bcs.
    CALL METHOD send_request->set_document( document ).
  4. Set instant sending:
    CALL METHOD send_request->set_send_immediately( 'X' ).
  5. Set recipient:
    DATA: recipient TYPE REF TO if_recipient_bcs.
    CALL METHOD send_request->add_recipient               EXPORTING                          i_recipient = recipient                          i_express = 'X'.
  6. Send the document:
    CALL METHOD send_request->send(               EXPORTING                          i_with_error_screen = 'X'               RECEIVING                          result = sent_to_all ).
    IF sent_to_all = 'X'.               WRITE text-003.
    ENDIF.
    COMMIT WORK.

As the result of this code execution, I got the blank email with two attachments: one with the HTM extension and one with the DOC. I would like that the content of the HTM-document (container with im_text, im_subject) will be displayed in the message body and the only DOC-file will be sent as an attachment. How can I get the desired result?

 

Thanks.


how to upload two sheets data into internal table

$
0
0

I have a requirement to upload multiple sheet data like header data in sheet 1 and item data in sheet 2 as shown below.

 

sheet 1

 

 

Header 1Header 2Header 3Header 4

h1

h2

val..

val

val..

val

val..

val

 

sheet 2

 

item1item1item1item1

i1

i1

i2

i2

val

val

val

val

val

val

val

val

val

val

val

val

update table from dynamic internal table

$
0
0

Hi all.

 

i will explain my requirement briefly, i have to create an dynamic ALV report, in selection screen user will give the table name and one field i.e date.

 

i am displaying all the records of the table given by the user, and one more column at the end (in alv output) . User will update only this last column, and i have to update the DATBI field of that table from this one, as this last field in alv is not there in the table, no data gets updated.

some tables has many key fields .

My internal table is field symbols type standard table, hence i can not change its fields value. as the type is unknown.

 

i want to swap the values of the fields of this field symbol. the last field value user will change with the datbi field of that table .

Based on postal code , transport zone get fetched issue?

$
0
0

Hi Experts,

 

i have one query regarding XD02 t code.--> general data --> in change mode

i am facing a issue as below:-

 

when i am going to change the postal code in address tab and press enter, the transport zone value fetched automatically

or you can say change automatically w.r.t Postal code entered. .

 

My questions

 

1) Is it a sap standard functionality ?

2) if it is not sap standard functionality, is their any user_exit for that or any other way  through customization/setting?

Any way to sync outlook 2010 contacts,calendar and tasks with sap r3

$
0
0

Hey Guys,

 

System: SAP r/3 ECC 6.0

 

i'm relativ new to the SAP world and i have a problem. at the moment i try to develop a mini mobile crm tool with bsp.

now i'm searching for a method to get contacts- , calendar- and tasks data from outlook into my application and the same backwords.

is there any easy way to do this?

if i get the data from outlook into sap, it would be no problem to get this into my application. but i dont know how to get this connection.

 

i just find solutions for business one, businessByDesign or SAP CRM.

 

i dont need full outlook integration. just a way to create/get contacts from outlook and sync the sap calendar with the outlook calendar. everything in both ways.

 

thanks for your help.

I AM GETTING ERROR WHILE CHECKING THE DATA USING THE BAPI BAPI_ACC_DOUCMENT_CHECK FOR F-64TCODE

$
0
0

I AM GETTING ERROR WHILE CHECKING THE DATA USING THE BAPI BAPI_ACC_DOUCMENT_WHILE PERFORMNIGN CHECK FOR A FILE WHICH IS BASED ON THE F-64 RECORDING.

 

Please any one help me in how to pass data to these bapi  through the  se37

 

 

 

Thanks in advance.

 

Narendra reddy

Oops ALV screen refresh issue when using SAPGUI_SET_FUNCTIONCODE

$
0
0

Hi All,

 

I am facing issue while I am trying to refresh ALV data 2nd time (update with new data), when using FM - SAPGUI_SET_FUNCTIONCODE.

If I comment this FM, then refresh works ok.

 

My scenario is as per below, no POV event used.

 

===

  1. Above part of screen has some display only fields, suppose ITEM1.
  2. Below part has Oops ALV grid (using cl_gui_alv_grid) with an editable checkbox, like available inventory for this ITEM1.
  3. User selects check-box one by one in this ALV and without any further action from user, there should be a popup to tell that ITEM1 is fulfilled (suppose after 3 records selected). To do this popup,  I am calling FM - SAPGUI_SET_FUNCTIONCODE in event handling of alv.
  4. Once control reach PAI via this FM, some calculations are done in PAI and popup shown if required.
  5. When user gets popup that ITEM1 is done, they will press a pushbutton 'NEXT' which will show ITEM2 in top screen part and corresponding ITEM2 inventory records should be shown in ALV area now so that user can select again.

 

Point 5 is not working, no matter what I do, even on ITEM2 system is still showing ALV records of ITEM1 only.

 

I am using refresh_table_display and internal table is populated correctly with ITEM2 data, but still ITEM1 data is shown. If I comment FM - SAPGUI_SET_FUNCTIONCODE, then everything is working well.

 

I also tried to replace with CL_GUI_CFW=>SET_NEW_OK_CODE, but same refresh problem occurs.

 

Please help, let me know if more details are required.

Plant & Company Code Relation table

$
0
0

Hi ,

 

In my Report i need to Validate wheather the Supplying Plant and Receiving Plant are Under the same Company code or not. In which table i can find what all the plants assigned to  particular Company Code.


get M_SECURITY_SESSION_COOKIE from CL_HTTP_SERVER

$
0
0

Hello,

 

How can I get M_SECURITY_SESSION_COOKIE from class CL_HTTP_SERVER ?

 

I try:

 

call function 'HTTP_GET_CURRENT_SERVER_CB'       importing         server_cb = lo_http_server       exceptions          others    = 0.

but I can't get the attribute because is protected. How can I get it?

 

Thank you

Modify DB table from internal table or work area

$
0
0

Hi all,

 

I have two ways to updata a DB table.

 

Option1:

LOOP gt_01 INTO gs_01.

  gs_02-xxx = gs_01-xxx.

  gs_02-yyy = gs_01-yyy.

  APPEND gs_02 TO gt_02.

ENDLOOP.

 

UPDATE DB FROM TABLE gt_02.

 

 

Option2:

LOOP gt_01 INTO gs_01.

  gs_02-xxx = gs_01-xxx.

  gs_02-yyy = gs_01-yyy.

  UPDATE DB FROM  gs_02.

ENDLOOP.

 

 

I prefer Option2, but it needs an extra internal table and in my real problem, this table could be very large.

So does it matter if I write UPDATE in the LOOP(Option2), would it cause some DB related performance issues?

HR ABAP for HCM Consultants

$
0
0

Hi All,


I need to start HR ABAP, small reporting , enhancements, debugging etc..


I dont have any programming knowledge, so kinldy let me know where to start for HR ABAP.


any ref docs online


thanks

SK

Problems with BAPI_BUS2002_GET_STATUS

$
0
0

Hey,

 

we have the problem, that the BAPI doesn't work in a loop.

 

Means:

 

I have an internal table with n activities. In a loop I get some information's and now I want to get the statusinformations about the activitivies.

 

The first cycle I get the informations (import network number), in the second one the tables E_ACTIVITY_SYSTEM_STATUS and E_ACTIVITY_USER_STATUS are empty.

 

Some ideas?

 

Regards Thomas

Persistent Class - problem with inheritance

$
0
0

Hi.

 

According to SAP Help, I want to develop persistent classes with inheritance.

 

I have a DB table, which is structured very similar to system table INDX. This table contents two kinds of records, which are differed by the field RELID. This means, I have records with RELID = SO and records with RELID = SP. In the current, very procedural coding, there are many IFs (IF RELID = SO....elseif RELID = SP .... endif). I want to get rid of them and in addition to that, there are many reasons to make an object oriented application of this program. Maybe in the future, there will be more RELIDs and each ELSEIF has to be extended.


So let's get to object orientation - down to the persistence layer.


Because there is some coding, which is depending on this difference, I want to have two kinds of persistent objects (= two different classes), both classes are inheriting from the same superclass. In the superclass, I want to code the coding, that has to be proceeded by all records, in the subclasses the coding, which is special for this RELID (means: the coding with the IF and ELSEIF-Coding).

 

So I defined the superclass ZCL_XYZ and the inheriting subclasses ZCL_XYZ_SO and ZCL_XYZ_SP.


If there is another RELID in the future, I would make another class only with the special coding, related to the new RELID. This makes sense!

 

At First, I read all the relevant records into an static internal table, which saves the key fields of the table and the object (I think, this is called a "Multiton Design Pattern"). In particular, this internal table stores all persistent objects and assigns them to the related DB record. The columns of this internal table are: The key fields of my DB-table (let's call the table XYZ, same structure like INDX) and an additional column for the objects (type ref to ZCL_XYZ). In column ZCL_XYZ are all objects of a subtype of ZCL_XYZ. Each object stores the content of the relating database record in his attributes.

 

The problem is: If I want to set one of the DB fields (i. e. XYZ-LOEKZ), I call the SET_LOEKZ-method of my persistent subclass. For instance:

 

READ TABLE instances assigning field-symbol.....

index ....

 

<instance>-persistent_object->SET_LOEKZ( ABAP_TRUE ).

 

This works fine. I can see in my persistent object, that the field has been filled with an 'X'. To get this X into the record on the database, I have to do a commit work. And this is the problem. After commit work, all attributes (RELID, LOEKZ, etc.) of ALL of my persistent objects are empty. In my internal table "instances" I can see all objects, but they do have all empty attributes.

 

I don't know, why. I searched and debugged for days without finding a reason. It seems, that all objects are rebuilt, but why - and why with empty attributes?

 

Today I read the linked document in the SAP Help (see above, at the beginning of this posting), and that I need atype identifier field in my DB table. I added this type identifier field, added it into the mapping rules as type identifier field, but when I want to activate the persistent class, I get the following syntax error:


The component TABLE_LINE is not contained in key "PRIMARY_KEY" of table "KEY_TAB_FOUND_LOCAL", or the key is not statically known.


The coding line with the syntax error is in IF_OS_CA_PERSISTENCY~GET_PERSISTENT_BY_KEY_TAB is this statement:


            read table key_tab_found_local
                  transporting no fields
                  with table key table_line = business_key.


This is a statement in the generated coding of my persistent class. KEY_TAB_FOUND_LOCAL is an internal table - type standard table of BUSINESS_KEY with default key!


I don't know, what kind of problem causes the syntax error in the automatically generated coding. If I delete the type identifier field from my DB-table XYZ, the activation process works fine, but I have the problem with the deleted object attributes after COMMIT WORK.


What I am doing wrong???? How can I get my application running with inheriting persistent classes???


There is just ONE answer, I don't want to hear: "Don't use persistent classes".   I want to use them, the SAP Help says it works. I don't want to rebuild my application. I just want to make it working.

Viewing all 8332 articles
Browse latest View live


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