No boolean in ABAP?
Hi,
I am just starting at the tip of the ABAP / SAP iceberg. Any particular reason why the one-bit-length boolean data type not featuring in ABAP?
Thanks.
>
BreakPoint wrote:
>
type-pools: abap.
>
> data: my_flag type boolean. "default false.
>
>
Any idea, why SAP has different "Definition" of Boolean (X=True, -=False, Space=Unknown) rather than industry standards True and False.
Regards,
Naimesh Patel
Similar Messages
-
Gentlemans!!
I'm wondering if the boolean type data exists in Abap Object and if it used when we define methods.
I used to use it in C++ and Java and I still don't know if this it's used or even exists in Abap Objects.
Thanks for your help.
Regards,
Polak.Hello,
The boolean type don't exist in ABAP.
In ABAP we used to refer to the type-pool ABAP where exists a type ABAP_BOOL (character length 1) where X = true and space = false. To refer to these values there are two constants: ABAP_TRUE and ABAP_FALSE.
To access the type-pool use the transaction SE11 select Type Group and enter ABAP.
Regards, -
Boolean data element in ABAP Dictionary
Dear friends,
Is it possible to have a Boolean variable defined in the domain without having the value range ???
Regards,
Vivek KHi Vivek,
If you are speaking of a boolean VARIABLE .. it has a default value range.
However, I do not know what is meant by boolean variable in a DOMAIN.
Anyway, as far as I can think of a default value range should be associated with it.
Regards,
Sameer -
Char1 in ABAP Side & Boolean in Java Side
Hello,
When importing a BAPI at Java side, I have a problem to deal with a field of type char1 (referenced to a domain with two fixed values : 'X' et ' ') which is becoming a boolean at Java Side.
I found posts talking about the same problems but I didn't find answers.
Have anyone encountred this problem before?
Thanks in advance for your help,
ImaneAThank you John & Srikanth for your replies.
My issue is that the Java side doesn't recognize the 'X' or ' '. It means that for Java side, the field is always empty.
We tried a domain with no values instead of 'X' and ' ' but it still doesn't recognize the content of field even if it is a String now and no longer a boolean in java side.
Do you have any idea how to solve this problem?
Thanks in advance for your help.
Regards,
Imane -
Getting JS variable value in ABAP variable
hi experts,
I am fairly new to ABAP programming so please bear with me. To my issue.
I am creating a BSP which will read from the tax number table in CRM into an itab.
Next it loops into an wa and then passes each tax number through a javascript/JQuery API to validate the number.
The JSON response then comes back and is stored in a JS variable.
I am unclear how to get this into an ABAP variable so I can handle as needed. I have read some posts but they seem to be created for those ABAP experts which I am not there yet.
Any help is most appreciated.
thank you kindly!
ChrisThanks for the reply Kiran.
I am still stuck where I try to create the hidden field, assign the JS variable value to it and then retrieve on server side using ABAP.
I read some places where it mentions accessing in the controller but this is not specific enough for me to know what to do. Here is a snippet of my JS/html code.
<form id="api">
<div><input type="hidden" name="json" id="json" value="" /></div>
var json = data;
document.getElementById("json").value = json;
document.api.submit();
</form>
I am using a Jquery api to get a boolean value and storing it in the json variable. then I want to pass that value to an ABAP variable. I did maintain a page attribute of json type STRING as well. I also tried maintaining a controller class attribute of the same. I did not redefine any controller class methods.
Your help is most appreciated.
thx
Chris -
Pricing : ABAP to Java conversion help needed
Hi all.
I am basically an ABAP developer. My recent assignment needs some java coding.
It will be very helpful if we anybody helps me in finding the corresponding pricing fields in java.
The abap code is as follows
check : xkomv - kgrpe = ' '.
check: xkomv - xkbetr ne 0.
check : komp - kpein ne 0.
if komp - netwr < 0.
komp - netpr = 0 - komp - netpr.
endif.
xkwert = ( ( ( komp - netpr * ( 100000 + xkomv - xkbetr)) / 100000)
komp-mglme / komp-kumza * komp - kumne / 1000 / komp - kpein )
- komp-netwr.
Please help in converting this abap code to its corresponding java code.
Thanks and Regards
DeepikaHere is the code I have developed: Please check and let me know if there are any changes
import java.math.BigDecimal;
import com.sap.spe.pricing.customizing.PricingCustomizingConstants;
import com.sap.spe.pricing.transactiondata.PricingTransactiondataConstants;
import com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit;
import com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit;
import com.sap.spe.pricing.transactiondata.userexit.ValueFormulaAdapter;
public class ZS2S_IPC_ZDCP extends ValueFormulaAdapter {
public BigDecimal overwriteConditionValue(
IPricingItemUserExit item,
IPricingConditionUserExit condition) {
BigDecimal kompKumza = new BigDecimal(String.valueOf(condition.getFraction().getNumerator()));
BigDecimal kompKumne = new BigDecimal(String.valueOf(condition.getFraction().getDenominator()));
boolean xkomvKgrpe = condition.isGroupCondition();
BigDecimal kompKpein = condition.getPricingUnit().getValue();
BigDecimal kompNetwr = item.getNetValue().getValue();
BigDecimal kompNetpr = item.getNetPrice().getValue();
BigDecimal xkomvKbetr = condition.getConditionRate().getValue();
BigDecimal kompMglme = item.getBaseQuantity().getValue();
if ( xkomvKgrpe = true )
return PricingTransactiondataConstants.ZERO;
if ( kompKumza != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if ( kompKumne != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if ( kompKpein != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if (kompNetwr.compareTo(PricingTransactiondataConstants.ZERO) < 0 )
kompNetpr = (PricingTransactiondataConstants.ZERO).subtract(kompNetwr);
BigDecimal y = new BigDecimal("100000");
BigDecimal a = y.add(xkomvKbetr);
BigDecimal temp = kompNetpr.multiply(a);
BigDecimal result1 = temp.divide(y, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal result2 = result1.multiply(kompMglme)
.divide(kompKumza, 2 BigDecimal.ROUND_HALF_UP).multiply(kompKumne).divide(kompKpein, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal Result = result2.subtract(kompNetwr);
return Result;
Edited by: Deepika Mallya on Aug 6, 2009 9:08 AM -
How to print PDF file content from ABAP in background?
Hi,
Is it possible to print PDF file content from ABAP in background?
I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
Please have you any suggestions?
Thank you
Tomas<b><u>Solution:</u></b><br>
<br>
The target output device must support PDF print, this is only one limitation.<br>
<br>
REPORT z_print_pdf.
TYPE-POOLS: abap, srmgs.
PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
p_immed AS CHECKBOX.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
DATA: lv_rc TYPE i,
lv_filter TYPE string.
DATA: lt_files TYPE filetable.
FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
file_filter = lv_filter
CHANGING
file_table = lt_files
rc = lv_rc
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0 AND lv_rc EQ 0.
MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
IF sy-subrc EQ 0.
p_fname = <fs_file>-filename.
ENDIF.
AT SELECTION-SCREEN.
DATA: lv_name TYPE string,
lv_result TYPE boolean.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = lv_name
RECEIVING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
IF lv_result NE abap_true.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
PERFORM process.
FORM process.
DATA: lv_name TYPE string,
lv_size TYPE i,
lv_data TYPE xstring,
lv_retcode TYPE i.
DATA: lt_file TYPE srmgs_bin_content.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_name
filetype = 'BIN'
IMPORTING
filelength = lv_size
CHANGING
data_tab = lt_file
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_size
IMPORTING
buffer = lv_data
TABLES
binary_tab = lt_file
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
IF lv_retcode EQ 0.
WRITE: / 'Print OK' COLOR COL_POSITIVE.
ELSE.
WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
ENDIF.
ENDFORM. " PROCESS
FORM print USING iv_prndst TYPE rspopname
iv_content TYPE xstring
CHANGING ev_retcode TYPE i.
DATA: lv_handle TYPE sy-tabix,
lv_spoolid TYPE rspoid,
lv_partname TYPE adspart,
lv_globaldir TYPE text1024,
lv_dstfile TYPE text1024,
lv_filesize TYPE i,
lv_pages TYPE i.
CLEAR: ev_retcode.
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
dest = iv_prndst
doctype = 'ADSP'
copies = p_ncopi
immediate_print = p_immed
auto_delete = 'X'
IMPORTING
handle = lv_handle
spoolid = lv_spoolid
partname = lv_partname
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = lv_globaldir.
CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
TRANSFER iv_content TO lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CLOSE DATASET lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
EXPORTING
iv_content = iv_content
IMPORTING
ev_pages = lv_pages.
lv_filesize = XSTRLEN( iv_content ).
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = lv_handle
partname = lv_partname
size = lv_filesize
pages = lv_pages
no_pdf = ' '
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = lv_handle
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
ENDFORM. " PRINT -
Splash screen ABAP (Was 6.20) SAPGui 6.20
I love splash screens. A small pop-up window with a picture should come for say 5 to 10 seconds and disappear by a timer task.
Giving such timer splash screens at START or END makes the application attractive. I do it in VB PB & Java.
How to do Slash screen in ABAP SAP GUI 6.20 WAS 6.20?
Should be thrown up as a "floating" popup.
Regards & Hopeful
-jncWith good tips from Thomas Jung
I made 2 function modules to suit my whims.
SAP being a serious Businesss Software you cannot have too many JPGs floating around! One or two is fun.
In Function group uou need two screens 0806 & 2009 which are essentially blank.
I put 2 title Bars - 0806 "SAP - JOB in Progress"; 2009 - "SAP - JOB OVER!!"
Code listing for function: ZJNC_START_SPLASH
Description: Show Splash at Start
FUNCTION zjnc_start_splash.
""Local interface:
*" IMPORTING
*" REFERENCE(IMAGEFILE) TYPE C DEFAULT 'THANKS.JPG'
*" REFERENCE(WIDTH) TYPE I DEFAULT 415
*" REFERENCE(HEIGHT) TYPE I DEFAULT 274
*" REFERENCE(TIMEOUT) TYPE I DEFAULT 3
*" REFERENCE(CALLBACK) TYPE C
Global data declarations
MOVE imagefile TO g_name.
MOVE width TO picwidth.
MOVE height TO picheight.
MOVE timeout TO pictimeout.
MOVE callback TO piccallback.
TRANSLATE piccallback TO UPPER CASE.
PERFORM getpicurl.
CALL SCREEN 0806.
ENDFUNCTION.
Code listing for function: ZJNC_END_SPLASH
Description: Show Splash at End
FUNCTION ZJNC_END_SPLASH.
""Local interface:
*" IMPORTING
*" REFERENCE(IMAGEFILE) TYPE C DEFAULT 'THANKS.JPG'
*" REFERENCE(WIDTH) TYPE I DEFAULT 415
*" REFERENCE(HEIGHT) TYPE I DEFAULT 274
*" REFERENCE(TIMEOUT) TYPE I DEFAULT 3
Global data declarations
MOVE imagefile TO g_name.
MOVE width TO picwidth.
MOVE height TO picheight.
MOVE timeout TO pictimeout.
PERFORM getpicurl.
CALL SCREEN 2009.
ENDFUNCTION.
Code listing for: LZUTILTOP
TOP level Include of Function Group ZUTIL
Author Jayanta Narayan Choudhuri
Flat 302
395 Jodhpur Park
Kolkata 700 068
Email [email protected]
URL: http://www.geocities.com/ojnc
FUNCTION-POOL zutil. "MESSAGE-ID ..
TYPE-POOLS: abap.
DATA: graphic_url(255),
g_result TYPE i,
g_linesz TYPE i,
g_filesz TYPE i,
g_name(100).
TYPES: t_graphic_line(256) TYPE x.
DATA: graphic_line TYPE t_graphic_line,
graphic_table TYPE TABLE OF t_graphic_line.
DATA: picwidth TYPE i,
picheight TYPE i,
pictimeout TYPE i,
piccallback(60) TYPE c,
first TYPE boolean.
CLASS ZCL_ES_SPLASH_SCREEN DEFINITION
CLASS zcl_es_splash_screen DEFINITION.
PUBLIC SECTION.
EVENTS on_close.
METHODS constructor
IMPORTING
!i_num_secs TYPE i DEFAULT 5
!i_url TYPE c
!i_width TYPE i
!i_height TYPE i.
PROTECTED SECTION.
METHODS handle_end_of_timer
FOR EVENT finished OF cl_gui_timer.
PRIVATE SECTION.
DATA container TYPE REF TO cl_gui_dialogbox_container.
DATA image TYPE REF TO cl_gui_picture.
DATA timer TYPE REF TO cl_gui_timer.
ENDCLASS. "ZCL_ES_SPLASH_SCREEN DEFINITION
CLASS ZCL_ES_SPLASH_SCREEN IMPLEMENTATION
CLASS zcl_es_splash_screen IMPLEMENTATION.
METHOD constructor.
DATA: image_width TYPE i,
image_height TYPE i.
COMPUTE image_width = i_width + 30.
COMPUTE image_height = i_height + 50.
CREATE OBJECT container
EXPORTING
width = 10
height = 10
top = 10
left = 10
name = 'DialogSplash'.
CALL METHOD container->set_caption
EXPORTING
caption = g_name.
CREATE OBJECT image
EXPORTING
parent = container.
CALL METHOD image->load_picture_from_url
EXPORTING
url = i_url.
image->set_display_mode( image->display_mode_normal_center ).
cl_gui_cfw=>flush( ).
container->set_metric( EXPORTING metric = image->metric_pixel ).
DATA: myleft TYPE i,
mytop TYPE i.
COMPUTE myleft = ( 800 - image_width ) / 2.
COMPUTE mytop = ( 600 - image_height ) / 2.
IF myleft < 0.
MOVE 0 TO myleft.
ENDIF.
IF mytop < 0.
MOVE 0 TO mytop.
ENDIF.
container->set_position(
EXPORTING
height = image_height
left = myleft
top = mytop
width = image_width ).
cl_gui_cfw=>update_view( ).
CREATE OBJECT timer.
timer->interval = i_num_secs.
SET HANDLER me->handle_end_of_timer FOR timer.
timer->run( ).
cl_gui_cfw=>flush( ).
ENDMETHOD. "constructor
METHOD handle_end_of_timer.
I wanted NAMASTE to remain until JOB was complete.
IF container IS NOT INITIAL.
container->free( ).
CLEAR container.
FREE container.
ENDIF.
IF timer IS NOT INITIAL.
timer->free( ).
CLEAR timer.
FREE timer.
ENDIF.
cl_gui_cfw=>flush( ).
RAISE EVENT on_close.
ENDMETHOD. "handle_end_of_timer
ENDCLASS. "ZCL_ES_SPLASH_SCREEN IMPLEMENTATION
CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_close FOR EVENT on_close OF zcl_es_splash_screen.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_close.
IF sy-dynnr = 2009.
LEAVE PROGRAM.
ELSE.
MOVE abap_false TO first.
PERFORM (piccallback) IN PROGRAM (sy-cprog).
ENDIF.
ENDMETHOD. "on_close
ENDCLASS. "lcl_event_handler IMPLEMENTATION
DATA: splash TYPE REF TO zcl_es_splash_screen.
*& Module STATUS_0806 OUTPUT
MODULE status_0806 OUTPUT.
IF first IS INITIAL.
first = abap_true.
SET TITLEBAR 'TITLE0806'.
CREATE OBJECT splash
EXPORTING
i_num_secs = pictimeout
i_url = graphic_url
i_width = picwidth
i_height = picheight.
SET HANDLER lcl_event_handler=>on_close FOR splash.
ENDIF.
ENDMODULE. " STATUS_0806 OUTPUT
*& Module STATUS_2009 OUTPUT
MODULE status_2009 OUTPUT.
IF first IS INITIAL.
first = abap_true.
SET TITLEBAR 'TITLE2009'.
CREATE OBJECT splash
EXPORTING
i_num_secs = pictimeout
i_url = graphic_url
i_width = picwidth
i_height = picheight.
SET HANDLER lcl_event_handler=>on_close FOR splash.
ENDIF.
ENDMODULE. " STATUS_2009 OUTPUT
*& Form getpicurl
FORM getpicurl.
OPEN DATASET g_name FOR INPUT IN BINARY MODE.
REFRESH graphic_table.
CLEAR g_filesz.
DO.
CLEAR graphic_line.
READ DATASET g_name INTO graphic_line ACTUAL LENGTH g_linesz.
ADD g_linesz TO g_filesz.
APPEND graphic_line TO graphic_table.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET g_name.
CLEAR graphic_url.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = graphic_table
CHANGING
url = graphic_url
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_put_table = 2
dp_error_general = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. "getpicurl
Extracted by Direct Download Enterprise version 1.2 - E.G.Mellodew. 1998-2004 UK. -
Consuming the webservices in ABAP?
Hi Guys,
I have consumed a wsdl on the ECC 6.0 system, generate a proxy object and when i am trying to send the data i am gettitng the error as below.
I have also filled the soap action while creating the logical port through SOAMANAGER.
Error Error CL_SOAP_RUNTIME_CLIENT EXEC_PROCESSING
SOAP Runtime SOAP Fault Exception caught: : System.Web.Services.Protocols.SoapException:
Server did not recognize the value of HTTP Header SOAPAction: http://YYY/XZZSoap30/SoapOp.
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
any help or suggestions would be appreciated
Thanks,
RajRaj,
The below Link Might help
http://help.sap.com/saphelp_nw04/helpdata/en/7d/473978127144d2a77c94dd544e2e61/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d86cf1a4-0701-0010-409d-c568b1d2519e
Call a ABAP Web Service externally
Cheers
Agasthuri Doss -
Error Consuming a webservice from ABAP
Hi all,
I am consuming an external webservice from abap. I created teh proxy using WSDl file. While testing teh service its giving an exception like this-
"JAXB unmarshalling exception: Unable to create an instance of de.*******v2.MeldungType; nested exception is javax.xml.bind.UnmarshalExcept
ion: Unable to create an instance of de.****.MeldungType# - with linked exception:#[java.lang.InstantiationException]"
With a soapfaultcode: 1..
can any one help out in arriving at teh reason for this..
Regards
SandeepI've seen lots of unmarshalling errors whilst trying to consume web services via Web Dynpro Java... Usually, it was due to an inconsistency between the WSDL file being used and the underlying web service definition. It might be worth checking the WSDL you are using is correct and up to date, in case the underlying service interface has changed.
Also worth checking if you have any simple boolean type parameters defined as part of the service interface - they have to have a value assigned when you call the service and cannot be null.
HTH. -
How to use BI in netweaver 2004(trial edition for abap)?
I am new in BI field. I downloaded the netweaver 2004(trial edition for abap)and installed it on my laptop. But the system said I am not authorized to use BI function:(
how can I use it, thank youHi Phani,
You can test your TREX server by executing the following step:
Log on to your TREX server and open up the TREX console which you can find in the TREX program folder. Normally you are now inside the python_support folder.
Execute the following script by typing: "python runInstallationText.py" and hit Enter.
The script carries out the following tests:
● Deleting any test indexes that were generated for a previous script run
● Creating a test index
● Indexing documents
● Testing search functions
● Exact, error-tolerant (fuzzy), and linguistic searches
● Search using Boolean operators such as AND and OR
The results are displayed at the end of the script run. You see the tested calls and their statuses (OK or Failed).
When you run the script for the first time, the call Delete Index has the status Failed. This is because there was no existing text index to be deleted. If this is the only cell with the status Failed, the test was successful.
Below you will see the final output generated by the test script. As stated near the bottom of this screenshot our TREX is running very well or not if there is a problem.
Best regards,
Tom.
PS. Don't forget to reward helpfull answers -
Adobe interactive form in wd abap
hi,
When i set the enabled property to true for the interactive form in WD ABAP, it either doesnt display the form or the form comes in display mode,
Can you please tell me know if any,
Thanks,
SaujanyaHi Saujanya,
The interface of the UI element InteractiveForm contains the method
SET_LEGACY_EDITING_MODE, which in turn contains a Boolean parameter. The form is
then ready for input when
● The parameter has the value X.
● The property enabled in the UI element InteractiveForm is selected.
The following code fragment shows how this input readiness can be set up:
method WDDOMODIFYVIEW.
data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,
LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.
check first_time = abap_true.
LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT(u2018INTERACTIVE_FORM_1u2019).
*Replace INTERACTIVE_FORM_1 with Property 'ID' of your UI element InteractiveForm
LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.
LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).
endmethod.
Regards,
Runal -
Wanted to confirm my understaing for ABAP and JAVA mapping.
Am I correct in my assumption that these mapping techniques can be used only if input and ouput is in XML format ?
So if XI is receiving a flat comma separated text/non-XML file or an IDOC for that matter and output is NOT in XML format, say again flat text file or IDOC, I cannot use above two techniques?
All the docs I have read suggest that 'Execute' method is called when XML file/data is received, paresed using DOM/SAX/JAXB (for Java mapping) or IXML lib (for ABAP mapping) and then create a output XML file.
-Thanks in advanceHi Bob,
Here you have a code sample for deescaping. I have have written this code a couple of time ago. The incoming file can be any text format. It might be XML, but not necessarily.
The main method is not reqired, but good for testing.
Regards
Stefan
* Created on 28.09.2005
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
package sample;
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.util.Map;
public class Deescaping implements StreamTransformation{
public static void main (String[] args) {
try {
InputStream in = new FileInputStream(new File("in.xml"));
OutputStream out = new FileOutputStream(new File("out.xml"));
Deescaping change = new Deescaping();
change.execute(in, out);
} catch (Exception e) {
e.printStackTrace();
public void setParameter (Map map) {
public void execute (InputStream in, OutputStream out)
throws StreamTransformationException {
try {
int c;
while ((c = in.read()) != -1) {
if (c != '&') {
out.write(c);
} else {
// ampersand
String help = "&";
boolean exit = false;
// check the next 5 chars, if there is a ';'
for (int i = 0; i < 5 && !exit; i++) {
c = in.read();
if (c == -1) {
exit = true;
} else {
// another ampersand?
if (c == '&') {
out.write(help.getBytes());
help = "&";
i = 0; // check the next 5 chars
} else {
help = help + (char) c;
if (c == ';') {
exit = true;
if (help.equals("&")) {
help = "&";
if (help.equals("<")) {
help = "<";
if (help.equals(">")) {
help = ">";
if (help.equals(""")) {
help = """;
if (help.equals("'")) {
help = "'";
} // for
out.write(help.getBytes());
} // while
out.flush();
} catch (Exception e) {
throw new StreamTransformationException(e.getMessage(),e); -
Hi,
I have a doubt in one of the abap function module i use.
This contain code to retrieve ,update and delete and create values in table. I am using this function module to
retrieve ,update and delete and create values in table. This is the ABAP code.
FUNCTION ZUP_DESIG12.
*"*"Local Interface:
*" IMPORTING
*" VALUE(DESG_CODE) TYPE ZUP_DESIG-DESG_CODE OPTIONAL
*" VALUE(DESG_DESC) TYPE ZUP_DESIG-DESG_DESC OPTIONAL
*" VALUE(DESG_ACT) TYPE ZUP_DESIG-DESG_ACT OPTIONAL
*" VALUE(DESG_OPT) TYPE ZUP_DESIG-DESG_OPT OPTIONAL
*" EXPORTING
*" VALUE(DESG_CODE_C) TYPE ZUP_DESIG-DESG_CODE
*" VALUE(DESG_DESC_C) TYPE ZUP_DESIG-DESG_DESC
*" VALUE(DESG_ACT_C) TYPE ZUP_DESIG-DESG_ACT
*" VALUE(DESG_OPT_C) TYPE ZUP_DESIG-DESG_OPT
*" TABLES
*" WA STRUCTURE ZMSTR_DESIG
DATA CNT TYPE I.
SELECT MANDT DESG_CODE DESG_DESC DESG_ACT FROM ZMSTR_DESIG
INTO TABLE WA.
IF DESG_OPT = 'U'.
UPDATE ZMSTR_DESIG
SET DESG_DESC = DESG_DESC
DESG_ACT = DESG_ACT
WHERE DESG_CODE = DESG_CODE.
MESSAGE 'Updated Successfully' TYPE 'I'.
ELSEIF DESG_OPT = 'C'.
SELECT COUNT( * ) FROM ZMSTR_DESIG INTO CNT
WHERE DESG_CODE = DESG_CODE.
IF CNT > 0.
MESSAGE 'Duplicate Designation code' TYPE 'I'.
ELSE.
WA-DESG_CODE = DESG_CODE.
WA-DESG_DESC = DESG_DESC.
WA-DESG_ACT = DESG_ACT.
MODIFY ZMSTR_DESIG FROM WA.
MESSAGE 'Inserted successfully' TYPE 'I'.
ENDIF.
ELSEIF DESG_OPT = 'D'.
DELETE FROM ZMSTR_DESIG WHERE DESG_CODE = DESG_CODE.
MESSAGE 'Deleted successfully' TYPE 'I'.
ENDIF.
ENDFUNCTION.
can any one what is wrong in this function.
Regards,
H.V.SwathiMy doubt is how to write code to insert data to table. I have written code like this.
try{
String str1= wdContext.currentTestElement().getCode();
String str2= wdContext.currentTestElement().getDesc();
boolean str3= wdContext.currentTestElement().getAct();
String str4= wdContext.currentTestElement().getOpt();
String str5;
if(str3)
str5=new String("x");
else
str5=new String(" ");
Zup_Desig12_Input input=new Zup_Desig12_Input();
input.setDesg_Code(str1);
input.setDesg_Desc(str2);
input.setDesg_Act(str5);
input.setDesg_Opt(str4);
wdContext.nodeZup_Desig12_Input().bind(input);
wdContext.currentZup_Desig12_InputElement().modelObject().execute();
}catch(Exception e)
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
But i am getting java.lang.ArrayIndexOutOfBoundsException: -1
in line
input.setDesg_Act(str5);
can any one help me plz -
Component Configuration in Webdynpro ABAP
Hello,
I created a Webdynpro ABAP Application which works fine . Then I created a Component Configuration to hide a particular UI Element . Now how can I test it? Also I tried creating a iview on Portal and point to the Application name and Configuration name but still that UI Element shows up.
What is the right way of doing this.?
ThanksHi,
To test the web Dynpro Configuration
1) Right click the web dynpro component and select the Create/Change configuration item
2) A new application configuration window opens in that window give your Web Dynpro component name and in the Configuration id give a Name for your configuration and save it
3) After saving a new window opens with list of created configuration find your config file and select it and click on the go to configuration button
4) Here you will find the component name and Configuration id which we have already given
5) Choose change button here you will see Attribute, Component Defined and Web dynpro built-in tabs
6) select the context attribute which you have created in the custom controller with type boolean and set it to false to hide it
save the configuration and test it.
Note: To test the Configuration an configured application will be created under the web dynpro application right click and select test.
You can refer [this|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b52e13c3-0901-0010-8fa6-d11a51821b7c?quicklink=index&overridelayout=true] link.
Regards,
Arun.P
Maybe you are looking for
-
Downgrading from Windows 8.1 to Windows 8
I have upgraded to Windows 8.1 on my PC. Windows 8 came with my PC so i did not have to install now. It is working fine with me but I am an accountant and i use Sage Pastel. Ever since I upgraded to Windows 8.1 my Pastel has completely stopped workin
-
Check if a point lies inside a rectangle
Hi im making an application that displays a shape on the screen at different locations. The shape is a combination of an ellipse and a line. My problem is when i want to draw the shapes i created a method to check if the point given is contained by a
-
Hi all I am working on Scenario BC 4.7 to XI 3.0 In this scnario I am posting IDoc from R/3 system to BC server and then BC system will route tht IDoc-XML to XI system and thn I am sending tht Idoc Xml to FTP I configured BC adapter as sender on XI
-
Captivate 7 will not open in Windows 7
I have recently installed Capt7 however it doesnt start properly. I run the program in administrator, it starts and runs through the preparation screens, launches a new window (blank) and then closes down without any warning messages. Windows 7 ultim
-
How to get correctly any non english data e.g greek data in servlet??
Hello All, I have one textbox on form from where user will enter greek data and when i get that field data in servlet using request.getParameter("name") ,then it shows wierd text in servlet ,it ditorts all the characters that user enterd on page,how